Messages
Messages stored in the mailboxes of a user, labels, and outbound messages that are still queued for delivery.
List labels of a user
Lists persistent labels, including empty labels, with optional message counters. Requested counters are over searchable mailboxes (Junk, Trash and non-searchable messages excluded) by default; searchable=false counts all mailboxes.
Create a label
Creates a persistent label. Repeated creation returns the existing label.
Get label details
Returns a persistent label of the user.
Rename a label
Updates a label while preserving its stable ID and all message and filter assignments.
Delete a label
Asynchronously removes this label and its assignments from messages and filters.
Get label counters
Returns total and unseen counters for a custom label. By default, excludes Junk, Trash and non-searchable messages.
Get system flag counters
Returns total and unseen counters for a system flag. Supported flags: seen, answered, flagged, deleted, draft and unread. By default, excludes Junk, Trash and non-searchable messages. The unseen count for seen is always zero.
Get flagged message counters
Returns total and unseen counters for flagged messages. Alias for flag-counters/flagged; by default excludes Junk, Trash and non-searchable messages.
List messages in a mailbox
Lists all messages in a mailbox
Update messages
Updates message flags, labels and other properties, and can move messages to a different mailbox.
Delete all messages in a mailbox
Deletes all messages in a mailbox, either right away or as a background task when async is set.
Upload a message
Uploads either an RFC822 formatted message or a message structure to a mailbox. Raw message is stored unmodified, no headers are added or removed. If you want to generate the uploaded message from structured data fields, then do not use the raw property.
Search messages
Searches for messages that match the query, across all mailboxes or in one mailbox.
Search and update messages
Applies an action to all matching messages. The request returns immediately, the changes are made in a background task.
Get message details
Returns the parsed contents of a message: headers, text and HTML content, attachments and flags.
Update a message
Updates message flags, labels and other properties, and can move messages to a different mailbox.
Delete a message
Deletes a message. Except for drafts, the message is moved to the archive, where it can be restored until the archive retention time passes.
Get message source
Returns the full RFC822 formatted source of the stored message
Download an attachment
Returns attachment file contents in binary form
Forward a stored message
Re-forwards a message to an original forward target, or forwards it to some other address. This is useful when forwarding was turned on but the message was not delivered, so you can try again. Forwarding does not modify the original message.
Submit a draft for delivery
Submits a draft for delivery. The draft is moved to the Sent mail folder.
Update an outbound message
Updates the delivery time of an outbound email that is still queued. Delivery times in the past are replaced with the current time. Queue entries that are already being delivered can not be updated.
Delete an outbound message
You can delete outbound emails that are still in queue. Queue ID can be found from the `outbound` property of a stored email.