Get a Gmail message

Retrieve a specific Gmail message by ID with full content and metadata

yaml
type: "io.kestra.plugin.googleworkspace.mail.Get"

Get a message by ID

yaml
id: get_gmail_message
namespace: company.team

tasks:
  - id: list_messages
    type: io.kestra.plugin.googleworkspace.mail.List
    clientId: "{{ secret('GMAIL_CLIENT_ID') }}"
    clientSecret: "{{ secret('GMAIL_CLIENT_SECRET') }}"
    refreshToken: "{{ secret('GMAIL_REFRESH_TOKEN') }}"
    maxResults: 1

  - id: get_message
    type: io.kestra.plugin.googleworkspace.mail.Get
    clientId: "{{ secret('GMAIL_CLIENT_ID') }}"
    clientSecret: "{{ secret('GMAIL_CLIENT_SECRET') }}"
    refreshToken: "{{ secret('GMAIL_REFRESH_TOKEN') }}"
    messageId: "{{ outputs.list_messages.messages[0].id }}"

Get message with specific format

yaml
id: get_message_metadata
namespace: company.team

tasks:
  - id: get_full_message
    type: io.kestra.plugin.googleworkspace.mail.Get
    clientId: "{{ secret('GMAIL_CLIENT_ID') }}"
    clientSecret: "{{ secret('GMAIL_CLIENT_SECRET') }}"
    refreshToken: "{{ secret('GMAIL_REFRESH_TOKEN') }}"
    messageId: "1a2b3c4d5e6f7890"
    format: full
Properties

OAuth 2.0 Client ID

The OAuth 2.0 client ID from Google Cloud Console

OAuth 2.0 Client Secret

The OAuth 2.0 client secret from Google Cloud Console

Message ID

The ID of the message to retrieve

OAuth 2.0 Refresh Token

The OAuth 2.0 refresh token obtained through the authorization flow

OAuth 2.0 Access Token

The OAuth 2.0 access token (optional, will be generated from refresh token if not provided)

Default full

Message format

The format to return the message payload in (options: minimal, full, raw, metadata)

Default 120

The read timeout for the request (in seconds)

SubType string
Default ["https://www.googleapis.com/auth/gmail.modify","https://www.googleapis.com/auth/gmail.readonly","https://www.googleapis.com/auth/gmail.send"]

The OAuth scopes to use

List of OAuth 2.0 scopes required for the operation

The retrieved message

SubType

List of attachments in the message

SubType string

The BCC recipient email addresses

SubType string

The CC recipient email addresses

The sender email address

SubType string

The parsed headers of the message

The ID of the last history record that modified this message

The immutable ID of the message

Format date-time

The internal message creation timestamp

SubType string

List of IDs of labels applied to this message

The entire email message in an RFC 2822 formatted and base64url encoded string

Estimated size in bytes of the message

A short part of the message text

The message subject

The HTML body of the message

The plain text body of the message

The ID of the thread the message belongs to

SubType string

The recipient email addresses

The attachment ID

The attachment data as a base64url encoded string

The filename of the attachment

The MIME type of the attachment file

The size of the attachment in bytes