Modify

Modifies the labels on the specified message

4 variables
29 variables

Modifies the labels on the specified message

Authorization

To use this building block you will have to grant access to at least one of the following scopes:

  • Read, compose, send, and permanently delete all your email from Gmail
  • View and modify but not delete your email

Input

This building block consumes 4 input parameters

  = Parameter name
  = Format

userId STRING Required

The user's email address. The special value me can be used to indicate the authenticated user

id STRING Required

The ID of the message to modify

addLabelIds[] STRING

removeLabelIds[] STRING

Output

This building block provides 29 output parameters

  = Parameter name
  = Format

historyId INTEGER

The ID of the last history record that modified this message

id STRING

The immutable ID of the message

internalDate INTEGER

The internal message creation timestamp (epoch ms), which determines ordering in the inbox. For normal SMTP-received email, this represents the time the message was originally accepted by Google, which is more reliable than the Date header. However, for API-migrated mail, it can be configured by client to be based on the Date header

labelIds[] STRING

payload OBJECT

A single MIME message part

payload.body OBJECT

The body of a single MIME message part

payload.body.attachmentId STRING

When present, contains the ID of an external attachment that can be retrieved in a separate messages.attachments.get request. When not present, the entire content of the message part body is contained in the data field

payload.body.data BINARY

The body data of a MIME message part as a base64url encoded string. May be empty for MIME container types that have no message body or when the body data is sent as a separate attachment. An attachment ID is present if the body data is contained in a separate attachment

payload.body.size INTEGER

Number of bytes for the message part data (encoding notwithstanding)

payload.filename STRING

The filename of the attachment. Only present if this message part represents an attachment

payload.headers[] OBJECT

payload.headers[].name STRING

The name of the header before the : separator. For example, To

payload.headers[].value STRING

The value of the header after the : separator. For example, [email protected]

payload.mimeType STRING

The MIME type of the message part

payload.partId STRING

The immutable ID of the message part

payload.parts[] OBJECT

A single MIME message part

payload.parts[].body OBJECT

The body of a single MIME message part

payload.parts[].body.attachmentId STRING

When present, contains the ID of an external attachment that can be retrieved in a separate messages.attachments.get request. When not present, the entire content of the message part body is contained in the data field

payload.parts[].body.data BINARY

The body data of a MIME message part as a base64url encoded string. May be empty for MIME container types that have no message body or when the body data is sent as a separate attachment. An attachment ID is present if the body data is contained in a separate attachment

payload.parts[].body.size INTEGER

Number of bytes for the message part data (encoding notwithstanding)

payload.parts[].filename STRING

The filename of the attachment. Only present if this message part represents an attachment

payload.parts[].headers[] OBJECT

payload.parts[].mimeType STRING

The MIME type of the message part

payload.parts[].partId STRING

The immutable ID of the message part

payload.parts[].parts[] OBJECT

A single MIME message part

raw BINARY

The entire email message in an RFC 2822 formatted and base64url encoded string. Returned in messages.get and drafts.get responses when the format=RAW parameter is supplied

sizeEstimate INTEGER

Estimated size in bytes of the message

snippet STRING

A short part of the message text

threadId STRING

The ID of the thread the message belongs to. To add a message or draft to a thread, the following criteria must be met:

  • The requested threadId must be specified on the Message or Draft.Message you supply with your request.
  • The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard.
  • The Subject headers must match.