Skip to main content

Gmail

The Gmail plugin lets you connect your Gmail account to ToolJet apps to send, read, and manage emails within your ToolJet application.

Connection

You will need the following credential to connect with Gmail:

  • Client ID
  • Client Secret

These credentials are used to authenticate via OAuth2 and access Gmail data securely. You can generate the required credentials from the Google Cloud Console.

You can toggle on Authentication required for all users in the configuration. When enabled, users will be redirected to the OAuth consent screen the first time a query from this data source is triggered in the application. This ensures each user connects their own Gmail account securely.

Note: After completing the OAuth flow, the query must be triggered again to load the data.

Gmail Configuration

Supported Operations

User Info

MethodEndpointDescription
GET/gmail/v1/users/{userId}/profileGet user profile information

Messages

MethodEndpointDescription
GET/gmail/v1/users/{userId}/messagesList messages
POST/gmail/v1/users/{userId}/messagesCreate a message
GET/gmail/v1/users/{userId}/messages/{messageId}Get a specific message
DELETE/gmail/v1/users/{userId}/messages/{messageId}Delete a message
POST/gmail/v1/users/{userId}/messages/{messageId}/modifyModify message labels
POST/gmail/v1/users/{userId}/messages/{messageId}/trashMove message to trash
POST/gmail/v1/users/{userId}/messages/{messageId}/untrashRemove message from trash
POST/gmail/v1/users/{userId}/messages/sendSend a message
POST/gmail/v1/users/{userId}/messages/batchDeleteDelete multiple messages
POST/gmail/v1/users/{userId}/messages/batchModifyModify labels on multiple messages
GET/gmail/v1/users/{userId}/messages/{messageId}/attachments/{attachmentId}Get message attachment

Threads

MethodEndpointDescription
GET/gmail/v1/users/{userId}/threadsList threads
GET/gmail/v1/users/{userId}/threads/{threadId}Get a specific thread
DELETE/gmail/v1/users/{userId}/threads/{threadId}Delete a thread
POST/gmail/v1/users/{userId}/threads/{threadId}/modifyModify thread labels
POST/gmail/v1/users/{userId}/threads/{threadId}/trashMove thread to trash
POST/gmail/v1/users/{userId}/threads/{threadId}/untrashRemove thread from trash

Drafts

MethodEndpointDescription
GET/gmail/v1/users/{userId}/draftsList drafts
POST/gmail/v1/users/{userId}/draftsCreate a draft
GET/gmail/v1/users/{userId}/drafts/{draftId}Get a specific draft
PUT/gmail/v1/users/{userId}/drafts/{draftId}Update a draft
DELETE/gmail/v1/users/{userId}/drafts/{draftId}Delete a draft
POST/gmail/v1/users/{userId}/drafts/sendSend a draft

Labels

MethodEndpointDescription
GET/gmail/v1/users/{userId}/labelsList labels
POST/gmail/v1/users/{userId}/labelsCreate a label
GET/gmail/v1/users/{userId}/labels/{labelId}Get a specific label
PUT/gmail/v1/users/{userId}/labels/{labelId}Update a label
PATCH/gmail/v1/users/{userId}/labels/{labelId}Partially update a label
DELETE/gmail/v1/users/{userId}/labels/{labelId}Delete a label

Watch and History

MethodEndpointDescription
GET/gmail/v1/users/{userId}/historyGet mailbox history
POST/gmail/v1/users/{userId}/watchStart push notifications
POST/gmail/v1/users/{userId}/stopStop push notifications