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

Get the profile of the authenticated user.

Action Parameters

user_id
stringDefaults to me

Action Response

data
object
successful
boolean
error

Action to remove a label in gmail.

Action Parameters

user_id
stringDefaults to me
label_id
stringRequired

Action Response

data
object
successful
boolean
error

Send an email using gmail’s api.

Action Parameters

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

Action Response

data
object
successful
boolean
error

Action to create a new label in gmail.

Action Parameters

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

Action Response

data
object
successful
boolean
error

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

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

Action Response

data
object
successful
boolean
error

List all labels in the user’s gmail account.

Action Parameters

user_id
stringDefaults to me

Action Response

data
object
successful
boolean
error

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

user_id
stringDefaults to me
thread_id
stringRequired
page_token
string

Action Response

data
object
successful
boolean
error

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

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

Action Response

data
object
successful
boolean
error

Action to fetch all emails from gmail.

Action Parameters

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

Action Response

data
object
successful
boolean
error

Action to modify labels of a thread in gmail.

Action Parameters

user_id
stringDefaults to me
thread_id
stringRequired
remove_label_ids
array
add_label_ids
array

Action Response

data
object
successful
boolean
error

Modify a label to an email in gmail.

Action Parameters

user_id
stringDefaults to me
message_id
stringRequired
add_label_ids
array
remove_label_ids
array

Action Response

data
object
successful
boolean
error

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

query
stringRequired
person_fields
stringDefaults to emailAddresses,names,birthdays,genders

Action Response

data
object
successful
boolean
error

Create a draft email using gmail’s api.

Action Parameters

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

Action Response

data
object
successful
boolean
error

Fetch messages by message id from gmail.

Action Parameters

user_id
stringDefaults to me
message_id
stringRequired
format
stringDefaults to full

Action Response

data
object
successful
boolean
error

Action to reply to an email thread in gmail.

Action Parameters

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

Action Response

data
object
successful
boolean
error

Action to get contacts info of people.

Action Parameters

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

Action Response

data
object
successful
boolean
error

Get an attachment from a mail.

Action Parameters

user_id
stringDefaults to me
message_id
stringRequired
attachment_id
stringRequired
file_name
stringRequired

Action Response

data
object
successful
boolean
error