Skip to content
For LLMsView as Markdown·

Gmail

Send, read, and manage emails, threads, labels, and drafts via the Gmail REST API using OAuth2.

DetailValue
CategoryCommunication
Base URLhttps://gmail.googleapis.com
AuthenticationOAuth2 Authorization Code
Endpoints17
Connector keygmail

Using Gmail in a workflow

  1. Go to Connections and click New Connection.
  2. Pick Gmail from the marketplace.
  3. Enter your credentials (see Authentication above for what's expected).
  4. In a workflow, drop an API Call node and select this connection.
  5. Pick the operation you need from the Operation dropdown — the full list is below.

Available endpoints

EndpointSummary
GET /gmail/v1/users/{userId}/profileGet the current user's Gmail profile
GET /gmail/v1/users/{userId}/messagesList messages in the mailbox
POST /gmail/v1/users/{userId}/messagesSend a message
GET /gmail/v1/users/{userId}/messages/{id}Get a specific message by ID
DELETE /gmail/v1/users/{userId}/messages/{id}Permanently delete a message
POST /gmail/v1/users/{userId}/messages/{id}/modifyModify labels applied to a message
GET /gmail/v1/users/{userId}/threadsList threads in the mailbox
GET /gmail/v1/users/{userId}/threads/{id}Get a specific thread by ID
DELETE /gmail/v1/users/{userId}/threads/{id}Permanently delete a thread
GET /gmail/v1/users/{userId}/labelsList all labels in the mailbox
POST /gmail/v1/users/{userId}/labelsCreate a new label
PUT /gmail/v1/users/{userId}/labels/{id}Update a label
DELETE /gmail/v1/users/{userId}/labels/{id}Delete a label
GET /gmail/v1/users/{userId}/draftsList drafts in the mailbox
POST /gmail/v1/users/{userId}/draftsCreate a new draft
POST /gmail/v1/users/{userId}/drafts/sendSend an existing draft
DELETE /gmail/v1/users/{userId}/drafts/{id}Delete a draft

Each endpoint is documented in full below. Use the outline on the right to jump to one.

GET /gmail/v1/users/{userId}/profile

Get the current user's Gmail profile

DetailValue
Operation IDgetProfile
MethodGET
Path/gmail/v1/users/{userId}/profile

Parameters

NameLocationTypeRequired
userIdpathstringYes

Using this endpoint in a workflow

  1. Add an API Call node to your workflow.
  2. Pick your Gmail connection from the Connection dropdown.
  3. In the Operation dropdown, select getProfile.
  4. Fill in the parameter fields that appear. Use {{...}} to reference upstream values.

Required fields are marked — fill them or the call will fail at runtime.

What it returns

The API Call node writes the response to the workflow context:

{
  status: 200,
  success: true,
  data: { ...response body from the API... },
  latencyMs: 142
}

Reference response fields downstream as {{nodeId.data.path}}. The exact response shape is documented on the upstream Gmail API reference.

GET /gmail/v1/users/{userId}/messages

List messages in the mailbox

DetailValue
Operation IDlistMessages
MethodGET
Path/gmail/v1/users/{userId}/messages

Parameters

NameLocationTypeRequired
userIdpathstringYes
qquerystringNo
maxResultsqueryintegerNo
pageTokenquerystringNo

Using this endpoint in a workflow

  1. Add an API Call node to your workflow.
  2. Pick your Gmail connection from the Connection dropdown.
  3. In the Operation dropdown, select listMessages.
  4. Fill in the parameter fields that appear. Use {{...}} to reference upstream values.

Required fields are marked — fill them or the call will fail at runtime.

What it returns

The API Call node writes the response to the workflow context:

{
  status: 200,
  success: true,
  data: { ...response body from the API... },
  latencyMs: 142
}

Reference response fields downstream as {{nodeId.data.path}}. The exact response shape is documented on the upstream Gmail API reference.

POST /gmail/v1/users/{userId}/messages

Send a message

DetailValue
Operation IDsendMessage
MethodPOST
Path/gmail/v1/users/{userId}/messages

Parameters

NameLocationTypeRequired
userIdpathstringYes

Request Body

FieldType
rawstring
threadIdstring

Using this endpoint in a workflow

  1. Add an API Call node to your workflow.
  2. Pick your Gmail connection from the Connection dropdown.
  3. In the Operation dropdown, select sendMessage.
  4. Fill in the parameter fields that appear. Use {{...}} to reference upstream values.

Required fields are marked — fill them or the call will fail at runtime.

What it returns

The API Call node writes the response to the workflow context:

{
  status: 200,
  success: true,
  data: { ...response body from the API... },
  latencyMs: 142
}

Reference response fields downstream as {{nodeId.data.path}}. The exact response shape is documented on the upstream Gmail API reference.

GET /gmail/v1/users/{userId}/messages/{id}

Get a specific message by ID

DetailValue
Operation IDgetMessage
MethodGET
Path/gmail/v1/users/{userId}/messages/{id}

Parameters

NameLocationTypeRequired
userIdpathstringYes
idpathstringYes
formatquerystringNo

Using this endpoint in a workflow

  1. Add an API Call node to your workflow.
  2. Pick your Gmail connection from the Connection dropdown.
  3. In the Operation dropdown, select getMessage.
  4. Fill in the parameter fields that appear. Use {{...}} to reference upstream values.

Required fields are marked — fill them or the call will fail at runtime.

What it returns

The API Call node writes the response to the workflow context:

{
  status: 200,
  success: true,
  data: { ...response body from the API... },
  latencyMs: 142
}

Reference response fields downstream as {{nodeId.data.path}}. The exact response shape is documented on the upstream Gmail API reference.

DELETE /gmail/v1/users/{userId}/messages/{id}

Permanently delete a message

DetailValue
Operation IDdeleteMessage
MethodDELETE
Path/gmail/v1/users/{userId}/messages/{id}

Parameters

NameLocationTypeRequired
userIdpathstringYes
idpathstringYes

Using this endpoint in a workflow

  1. Add an API Call node to your workflow.
  2. Pick your Gmail connection from the Connection dropdown.
  3. In the Operation dropdown, select deleteMessage.
  4. Fill in the parameter fields that appear. Use {{...}} to reference upstream values.

Required fields are marked — fill them or the call will fail at runtime.

What it returns

The API Call node writes the response to the workflow context:

{
  status: 200,
  success: true,
  data: { ...response body from the API... },
  latencyMs: 142
}

Reference response fields downstream as {{nodeId.data.path}}. The exact response shape is documented on the upstream Gmail API reference.

POST /gmail/v1/users/{userId}/messages/{id}/modify

Modify labels applied to a message

DetailValue
Operation IDmodifyMessage
MethodPOST
Path/gmail/v1/users/{userId}/messages/{id}/modify

Parameters

NameLocationTypeRequired
userIdpathstringYes
idpathstringYes

Request Body

FieldType
addLabelIdsarray
removeLabelIdsarray

Using this endpoint in a workflow

  1. Add an API Call node to your workflow.
  2. Pick your Gmail connection from the Connection dropdown.
  3. In the Operation dropdown, select modifyMessage.
  4. Fill in the parameter fields that appear. Use {{...}} to reference upstream values.

Required fields are marked — fill them or the call will fail at runtime.

What it returns

The API Call node writes the response to the workflow context:

{
  status: 200,
  success: true,
  data: { ...response body from the API... },
  latencyMs: 142
}

Reference response fields downstream as {{nodeId.data.path}}. The exact response shape is documented on the upstream Gmail API reference.

GET /gmail/v1/users/{userId}/threads

List threads in the mailbox

DetailValue
Operation IDlistThreads
MethodGET
Path/gmail/v1/users/{userId}/threads

Parameters

NameLocationTypeRequired
userIdpathstringYes
qquerystringNo
maxResultsqueryintegerNo

Using this endpoint in a workflow

  1. Add an API Call node to your workflow.
  2. Pick your Gmail connection from the Connection dropdown.
  3. In the Operation dropdown, select listThreads.
  4. Fill in the parameter fields that appear. Use {{...}} to reference upstream values.

Required fields are marked — fill them or the call will fail at runtime.

What it returns

The API Call node writes the response to the workflow context:

{
  status: 200,
  success: true,
  data: { ...response body from the API... },
  latencyMs: 142
}

Reference response fields downstream as {{nodeId.data.path}}. The exact response shape is documented on the upstream Gmail API reference.

GET /gmail/v1/users/{userId}/threads/{id}

Get a specific thread by ID

DetailValue
Operation IDgetThread
MethodGET
Path/gmail/v1/users/{userId}/threads/{id}

Parameters

NameLocationTypeRequired
userIdpathstringYes
idpathstringYes

Using this endpoint in a workflow

  1. Add an API Call node to your workflow.
  2. Pick your Gmail connection from the Connection dropdown.
  3. In the Operation dropdown, select getThread.
  4. Fill in the parameter fields that appear. Use {{...}} to reference upstream values.

Required fields are marked — fill them or the call will fail at runtime.

What it returns

The API Call node writes the response to the workflow context:

{
  status: 200,
  success: true,
  data: { ...response body from the API... },
  latencyMs: 142
}

Reference response fields downstream as {{nodeId.data.path}}. The exact response shape is documented on the upstream Gmail API reference.

DELETE /gmail/v1/users/{userId}/threads/{id}

Permanently delete a thread

DetailValue
Operation IDdeleteThread
MethodDELETE
Path/gmail/v1/users/{userId}/threads/{id}

Parameters

NameLocationTypeRequired
userIdpathstringYes
idpathstringYes

Using this endpoint in a workflow

  1. Add an API Call node to your workflow.
  2. Pick your Gmail connection from the Connection dropdown.
  3. In the Operation dropdown, select deleteThread.
  4. Fill in the parameter fields that appear. Use {{...}} to reference upstream values.

Required fields are marked — fill them or the call will fail at runtime.

What it returns

The API Call node writes the response to the workflow context:

{
  status: 200,
  success: true,
  data: { ...response body from the API... },
  latencyMs: 142
}

Reference response fields downstream as {{nodeId.data.path}}. The exact response shape is documented on the upstream Gmail API reference.

GET /gmail/v1/users/{userId}/labels

List all labels in the mailbox

DetailValue
Operation IDlistLabels
MethodGET
Path/gmail/v1/users/{userId}/labels

Parameters

NameLocationTypeRequired
userIdpathstringYes

Using this endpoint in a workflow

  1. Add an API Call node to your workflow.
  2. Pick your Gmail connection from the Connection dropdown.
  3. In the Operation dropdown, select listLabels.
  4. Fill in the parameter fields that appear. Use {{...}} to reference upstream values.

Required fields are marked — fill them or the call will fail at runtime.

What it returns

The API Call node writes the response to the workflow context:

{
  status: 200,
  success: true,
  data: { ...response body from the API... },
  latencyMs: 142
}

Reference response fields downstream as {{nodeId.data.path}}. The exact response shape is documented on the upstream Gmail API reference.

POST /gmail/v1/users/{userId}/labels

Create a new label

DetailValue
Operation IDcreateLabel
MethodPOST
Path/gmail/v1/users/{userId}/labels

Parameters

NameLocationTypeRequired
userIdpathstringYes

Request Body

FieldType
namestring
messageListVisibilitystring
labelListVisibilitystring

Using this endpoint in a workflow

  1. Add an API Call node to your workflow.
  2. Pick your Gmail connection from the Connection dropdown.
  3. In the Operation dropdown, select createLabel.
  4. Fill in the parameter fields that appear. Use {{...}} to reference upstream values.

Required fields are marked — fill them or the call will fail at runtime.

What it returns

The API Call node writes the response to the workflow context:

{
  status: 200,
  success: true,
  data: { ...response body from the API... },
  latencyMs: 142
}

Reference response fields downstream as {{nodeId.data.path}}. The exact response shape is documented on the upstream Gmail API reference.

PUT /gmail/v1/users/{userId}/labels/{id}

Update a label

DetailValue
Operation IDupdateLabel
MethodPUT
Path/gmail/v1/users/{userId}/labels/{id}

Parameters

NameLocationTypeRequired
userIdpathstringYes
idpathstringYes

Request Body

FieldType
namestring

Using this endpoint in a workflow

  1. Add an API Call node to your workflow.
  2. Pick your Gmail connection from the Connection dropdown.
  3. In the Operation dropdown, select updateLabel.
  4. Fill in the parameter fields that appear. Use {{...}} to reference upstream values.

Required fields are marked — fill them or the call will fail at runtime.

What it returns

The API Call node writes the response to the workflow context:

{
  status: 200,
  success: true,
  data: { ...response body from the API... },
  latencyMs: 142
}

Reference response fields downstream as {{nodeId.data.path}}. The exact response shape is documented on the upstream Gmail API reference.

DELETE /gmail/v1/users/{userId}/labels/{id}

Delete a label

DetailValue
Operation IDdeleteLabel
MethodDELETE
Path/gmail/v1/users/{userId}/labels/{id}

Parameters

NameLocationTypeRequired
userIdpathstringYes
idpathstringYes

Using this endpoint in a workflow

  1. Add an API Call node to your workflow.
  2. Pick your Gmail connection from the Connection dropdown.
  3. In the Operation dropdown, select deleteLabel.
  4. Fill in the parameter fields that appear. Use {{...}} to reference upstream values.

Required fields are marked — fill them or the call will fail at runtime.

What it returns

The API Call node writes the response to the workflow context:

{
  status: 200,
  success: true,
  data: { ...response body from the API... },
  latencyMs: 142
}

Reference response fields downstream as {{nodeId.data.path}}. The exact response shape is documented on the upstream Gmail API reference.

GET /gmail/v1/users/{userId}/drafts

List drafts in the mailbox

DetailValue
Operation IDlistDrafts
MethodGET
Path/gmail/v1/users/{userId}/drafts

Parameters

NameLocationTypeRequired
userIdpathstringYes
maxResultsqueryintegerNo

Using this endpoint in a workflow

  1. Add an API Call node to your workflow.
  2. Pick your Gmail connection from the Connection dropdown.
  3. In the Operation dropdown, select listDrafts.
  4. Fill in the parameter fields that appear. Use {{...}} to reference upstream values.

Required fields are marked — fill them or the call will fail at runtime.

What it returns

The API Call node writes the response to the workflow context:

{
  status: 200,
  success: true,
  data: { ...response body from the API... },
  latencyMs: 142
}

Reference response fields downstream as {{nodeId.data.path}}. The exact response shape is documented on the upstream Gmail API reference.

POST /gmail/v1/users/{userId}/drafts

Create a new draft

DetailValue
Operation IDcreateDraft
MethodPOST
Path/gmail/v1/users/{userId}/drafts

Parameters

NameLocationTypeRequired
userIdpathstringYes

Request Body

FieldType
messageobject

Using this endpoint in a workflow

  1. Add an API Call node to your workflow.
  2. Pick your Gmail connection from the Connection dropdown.
  3. In the Operation dropdown, select createDraft.
  4. Fill in the parameter fields that appear. Use {{...}} to reference upstream values.

Required fields are marked — fill them or the call will fail at runtime.

What it returns

The API Call node writes the response to the workflow context:

{
  status: 200,
  success: true,
  data: { ...response body from the API... },
  latencyMs: 142
}

Reference response fields downstream as {{nodeId.data.path}}. The exact response shape is documented on the upstream Gmail API reference.

POST /gmail/v1/users/{userId}/drafts/send

Send an existing draft

DetailValue
Operation IDsendDraft
MethodPOST
Path/gmail/v1/users/{userId}/drafts/send

Parameters

NameLocationTypeRequired
userIdpathstringYes

Request Body

FieldType
idstring

Using this endpoint in a workflow

  1. Add an API Call node to your workflow.
  2. Pick your Gmail connection from the Connection dropdown.
  3. In the Operation dropdown, select sendDraft.
  4. Fill in the parameter fields that appear. Use {{...}} to reference upstream values.

Required fields are marked — fill them or the call will fail at runtime.

What it returns

The API Call node writes the response to the workflow context:

{
  status: 200,
  success: true,
  data: { ...response body from the API... },
  latencyMs: 142
}

Reference response fields downstream as {{nodeId.data.path}}. The exact response shape is documented on the upstream Gmail API reference.

DELETE /gmail/v1/users/{userId}/drafts/{id}

Delete a draft

DetailValue
Operation IDdeleteDraft
MethodDELETE
Path/gmail/v1/users/{userId}/drafts/{id}

Parameters

NameLocationTypeRequired
userIdpathstringYes
idpathstringYes

Using this endpoint in a workflow

  1. Add an API Call node to your workflow.
  2. Pick your Gmail connection from the Connection dropdown.
  3. In the Operation dropdown, select deleteDraft.
  4. Fill in the parameter fields that appear. Use {{...}} to reference upstream values.

Required fields are marked — fill them or the call will fail at runtime.

What it returns

The API Call node writes the response to the workflow context:

{
  status: 200,
  success: true,
  data: { ...response body from the API... },
  latencyMs: 142
}

Reference response fields downstream as {{nodeId.data.path}}. The exact response shape is documented on the upstream Gmail API reference.