Behavioral and logical model of how Gmail stores and organizes email data. Hover over any component for technical detail.
ⓘ Hover over any item to see detailed technical information
id in the message resource.
in:inbox is equivalent to label:INBOX.
payload.parts structure. Each part has its own MIME type, headers, and optionally body data or nested parts.
attachments.get endpoint with the attachment ID. Quota is counted against the account's Google storage allocation.
Gmail has no folder data structure at the storage layer. What users perceive as folders are label tags stored as metadata on each message object. This means a message can be "in" multiple places simultaneously.
When migrating from Gmail via tools like Google Workspace Migration or GAMME, label metadata must be captured and mapped explicitly. A naive IMAP migration flattens label data into folder structure and loses multi-label assignments.
The Gmail API (v1) surfaces messages as objects with a labelIds array. List operations use label filters as query parameters. All operations are message-centric, not folder-centric. Vault exports preserve label metadata in JSON format.
Label-as-metadata model: documented in Gmail API and Vault API official documentation. Underlying store architecture (Bigtable/Colossus): described at high level in Google infrastructure whitepapers; exact schemas are not publicly disclosed.