Gmail Get Custom

Get one or many Messages/Threads and manage labels with token caching

Thread → Get

AI-generated

Summary

Retrieve a specific Gmail thread by its Thread ID using a Google service account with delegated user access, optionally returning simplified thread data or only the messages within the thread.

Inputs

  • Service Account Email (required) — Email of the Google service account used for authentication.
  • Private Key (required) — Private key string for the service account, used to generate authentication tokens.
  • Delegated Email (required) — Email address of the Gmail user whose mailbox is accessed via delegation.
  • Thread ID (required) — ID of the Gmail thread to retrieve.
  • Simplify — Boolean to control if the retrieved thread should be simplified to parsed fields (headers and content) or returned as raw Gmail API data.
  • Return Only Messages — Boolean option to return only the array of messages within the thread, omitting thread-level metadata.

Output shape

a single item JSON object representing the thread or an array of messages if 'Return Only Messages' is true

If 'Return Only Messages' is enabled, the output consists of multiple items each containing a single message's data; otherwise, a single item is returned with the full thread data. The 'Simplify' option affects whether messages contain parsed header fields for easier use or raw API response structure.

Examples

Example 1: Get thread details with simplified message headers and body

Set 'Simplify' to true, provide valid 'Service Account Email', 'Private Key', 'Delegated Email', and 'Thread ID'. 'Return Only Messages' left false or unset to receive full thread metadata including simplified messages.

Example 2: Get only raw messages in a thread without thread metadata

Set 'Return Only Messages' to true with other required fields set. The output will be multiple items, each representing a message in the thread with simplified headers if 'Simplify' is true.

Links

Discussion