Resource: Message
An email message.
| JSON representation | 
|---|
{
  "id": string,
  "threadId": string,
  "labelIds": [
    string
  ],
  "snippet": string,
  "historyId": string,
  "internalDate": string,
  "payload": {
    object ( | 
              
| Fields | |
|---|---|
id | 
                
                   
 The immutable ID of the message.  | 
              
threadId | 
                
                   
 The ID of the thread the message belongs to. To add a message or draft to a thread, the following criteria must be met: 
  | 
              
labelIds[] | 
                
                   
 List of IDs of labels applied to this message.  | 
              
snippet | 
                
                   
 A short part of the message text.  | 
              
historyId | 
                
                   
 The ID of the last history record that modified this message.  | 
              
internalDate | 
                
                   
 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   | 
              
payload | 
                
                   
 The parsed email structure in the message parts.  | 
              
sizeEstimate | 
                
                   
 Estimated size in bytes of the message.  | 
              
raw | 
                
                   
 The entire email message in an RFC 2822 formatted and base64url encoded string. Returned in  A base64-encoded string.  | 
              
MessagePart
A single MIME message part.
| JSON representation | 
|---|
{ "partId": string, "mimeType": string, "filename": string, "headers": [ { object (  | 
                
| Fields | |
|---|---|
partId | 
                  
                     
 The immutable ID of the message part.  | 
                
mimeType | 
                  
                     
 The MIME type of the message part.  | 
                
filename | 
                  
                     
 The filename of the attachment. Only present if this message part represents an attachment.  | 
                
headers[] | 
                  
                     
 List of headers on this message part. For the top-level message part, representing the entire message payload, it will contain the standard RFC 2822 email headers such as   | 
                
body | 
                  
                     
 The message part body for this part, which may be empty for container MIME message parts.  | 
                
parts[] | 
                  
                     
 The child MIME message parts of this part. This only applies to container MIME message parts, for example   | 
                
Header
| JSON representation | 
|---|
{ "name": string, "value": string }  | 
                
| Fields | |
|---|---|
name | 
                  
                     
 The name of the header before the   | 
                
value | 
                  
                     
 The value of the header after the   | 
                
Methods | 
            |
|---|---|
                
 | 
              Deletes many messages by message ID. | 
                
 | 
              Modifies the labels on the specified messages. | 
                
 | 
              Immediately and permanently deletes the specified message. | 
                
 | 
              Gets the specified message. | 
                
 | 
              Imports a message into only this user's mailbox, with standard email delivery scanning and classification similar to receiving via SMTP. | 
                
 | 
              
                Directly inserts a message into only this user's mailbox similar to IMAP APPEND, bypassing most scanning and classification. | 
            
                
 | 
              Lists the messages in the user's mailbox. | 
                
 | 
              Modifies the labels on the specified message. | 
                
 | 
              
                Sends the specified message to the recipients in the To, Cc, and Bcc headers. | 
            
                
 | 
              Moves the specified message to the trash. | 
                
 | 
              Removes the specified message from the trash. |