Gmail

Learn how to use Gmail with Composio

Overview

Enum

GMAIL

Description

Connect to Gmail to send and manage emails.

Authentication Details

client_id
stringRequired
client_secret
stringRequired
oauth_redirect_uri
stringDefaults to https://backend.composio.dev/api/v1/auth-apps/add
scopes
stringDefaults to https://www.googleapis.com/auth/gmail.modify,https://www.googleapis.com/auth/userinfo.profile
token
stringRequired

Actions

Modify a label to an email in gmail.

Action Parameters

add_label_ids
array
message_id
stringRequired
remove_label_ids
array
user_id
stringDefaults to me

Action Response

data
object
error
successful
boolean

Create a draft email using gmail’s api.

Action Parameters

attachment
object
bcc
array
body
stringRequired
cc
array
extra_recipients
array
is_html
boolean
recipient_email
stringRequired
subject
stringRequired
thread_id
string
user_id
stringDefaults to me

Action Response

data
object
error
successful
boolean

Action to create a new label in gmail.

Action Parameters

label_list_visibility
stringDefaults to labelShow
label_name
stringRequired
message_list_visibility
stringDefaults to show
user_id
stringDefaults to me

Action Response

data
object
error
successful
boolean

Delete an email draft using gmail’s api.

Action Parameters

draft_id
stringRequired
user_id
stringDefaults to me

Action Response

data
object
error
successful
boolean

Delete an email message using gmail’s api. note: this action requires the integration to have the https://mail.google.com/ scope.

Action Parameters

message_id
stringRequired
user_id
stringDefaults to me

Action Response

data
object
error
successful
boolean

Action to fetch all emails from gmail.

Action Parameters

include_payload
booleanDefaults to True
include_spam_trash
boolean
label_ids
array
max_results
integerDefaults to 1
page_token
string
query
string
user_id
stringDefaults to me

Action Response

data
object
error
successful
boolean

Fetch messages by message id from gmail.

Action Parameters

format
stringDefaults to full
message_id
stringRequired
user_id
stringDefaults to me

Action Response

data
object
error
successful
boolean

Fetch messages by thread id from gmail with pagination support. to use pagination, you can set the ‘pagetoken’ in the request to the value of the ‘nextpagetoken’ in the response of the previous action. the ‘nextpagetoken’ is returned in the response of this action (i.e ‘fetchmessagebythreadid’) if there are more results to be fetched. if not provided, the first page of results is returned.

Action Parameters

page_token
string
thread_id
stringRequired
user_id
stringDefaults to me

Action Response

data
object
error
successful
boolean

Get an attachment from a mail.

Action Parameters

attachment_id
stringRequired
file_name
stringRequired
message_id
stringRequired
user_id
stringDefaults to me

Action Response

data
object
error
successful
boolean

Action to get info of contacts saved in google for an authorized account. a custom integration with https://www.googleapis.com/auth/contacts.readonly scope is required to use this action.

Action Parameters

page_token
string
person_fields
stringDefaults to emailAddresses,names,birthdays,genders
resource_name
stringDefaults to people/me

Action Response

data
object
error
successful
boolean

Action to get contacts info of people.

Action Parameters

other_contacts
boolean
page_size
integerDefaults to 10
page_token
string
person_fields
stringDefaults to emailAddresses,names,birthdays,genders
resource_name
stringDefaults to people/me
sync_token
string

Action Response

data
object
error
successful
boolean

Get the profile of the authenticated user.

Action Parameters

user_id
stringDefaults to me

Action Response

data
object
error
successful
boolean

List all email drafts using gmail’s api.

Action Parameters

max_results
integerDefaults to 1
page_token
string
user_id
stringDefaults to me

Action Response

data
object
error
successful
boolean

List all labels in the user’s gmail account.

Action Parameters

user_id
stringDefaults to me

Action Response

data
object
error
successful
boolean

Action to list threads in gmail. this action returns a list of threads and a page token to retrieve the next page of results. the next page token is returned in the response of this action (i.e ‘listthreads’) if there are more results to be fetched, which you can use in the ‘pagetoken’ field of the request to fetch the next page of results. if not available, the last page of results is returned.

Action Parameters

max_results
integerDefaults to 10
page_token
string
query
string
user_id
stringDefaults to me

Action Response

data
object
error
successful
boolean

Action to modify labels of a thread in gmail.

Action Parameters

add_label_ids
array
remove_label_ids
array
thread_id
stringRequired
user_id
stringDefaults to me

Action Response

data
object
error
successful
boolean

Move an email message to trash using gmail’s api.

Action Parameters

message_id
stringRequired
user_id
stringDefaults to me

Action Response

data
object
error
successful
boolean

Action to remove a label in gmail.

Action Parameters

label_id
stringRequired
user_id
stringDefaults to me

Action Response

data
object
error
successful
boolean

Action to reply to an email thread in gmail.

Action Parameters

bcc
array
cc
array
extra_recipients
array
is_html
boolean
message_body
stringRequired
recipient_email
stringRequired
thread_id
stringRequired
user_id
stringDefaults to me

Action Response

data
object
error
successful
boolean

Provides a list of contacts in the authenticated user’s grouped contacts that matches the search query. the query matches on a contact’s names, nicknames, emailaddresses, phonenumbers, and organizations fields that are from the contact source. a custom integration with https://www.googleapis.com/auth/contacts.readonly scope is required to use this action.

Action Parameters

other_contacts
boolean
pageSize
integerDefaults to 10
person_fields
stringDefaults to emailAddresses,names,phoneNumbers
query
stringRequired

Action Response

data
object
error
successful
boolean

Send an email using gmail’s api.

Action Parameters

attachment
object
bcc
array
body
stringRequired
cc
array
extra_recipients
array
is_html
boolean
recipient_email
stringRequired
subject
string
user_id
stringDefaults to me

Action Response

data
object
error
successful
boolean