Mail API
Mailboxes, threads, sending, filters, forwarding, aliases, and org mail policy.
| Endpoint | POST https://mail.api.gist.link/graphql |
| Token audience | audience=mail |
| Permission prefix | mail: |
Mint an access token for this API with your IAM key and audience=mail
— see Authentication.
Queries
Section titled “Queries”| Operation | Required permission | Description |
|---|---|---|
aliases |
mail:query:aliases |
Send-as aliases of one of the caller’s mailboxes. |
appPasswords |
mail:query:appPasswords |
The caller’s app passwords (IMAP/SMTP device credentials); secrets are never returned. |
catchAlls |
mail:query:catchAlls |
Catch-all routes for the organization’s domains. ROLE_ADMIN. |
email |
mail:query:email |
One message (e.g. a draft being edited); caller must own its mailbox. |
forwarders |
mail:query:forwarders |
Auto-forwarders of one of the caller’s mailboxes. |
health |
mail:query:health |
Liveness/identity probe; public. |
labels |
mail:query:labels |
Custom labels of one of the caller’s mailboxes. |
mailboxes |
mail:query:mailboxes |
All mailboxes in the organization. ROLE_ADMIN. |
mailboxSettings |
mail:query:mailboxSettings |
Per-mailbox settings (vacation responder, undo-send window). Caller must own the mailbox. |
mailboxStats |
mail:query:mailboxStats |
Per-folder unread counts for the sidebar badges. Scope to one mailbox with mailbox_uuid; omit it to aggregate across every mailbox assigned to the caller. |
mailClientConfig |
mail:query:mailClientConfig |
Connection settings to show next to app passwords for local email clients. |
mailFilters |
mail:query:mailFilters |
Filters (rules) of one of the caller’s mailboxes, in run order. |
mailTemplates |
mail:query:mailTemplates |
Reusable message templates of one of the caller’s mailboxes. |
myMailboxes |
mail:query:myMailboxes |
Mailboxes owned by the calling user. |
orgMailFilters |
mail:query:orgMailFilters |
Organization-level filters that run on every mailbox before per-mailbox filters. ROLE_ADMIN. |
orgMailPolicy |
mail:query:orgMailPolicy |
Organization-wide mail policy (spam level, DMARC action, retention…). ROLE_ADMIN. |
orgSenderRules |
mail:query:orgSenderRules |
Organization-level allow/block sender rules. ROLE_ADMIN. |
senderRules |
mail:query:senderRules |
Allow/block sender rules of one of the caller’s mailboxes. |
thread |
mail:query:thread |
One thread (with its messages); must belong to a mailbox the caller owns. |
threads |
mail:query:threads |
Threads in the caller’s mailboxes, newest activity first. Scope to one mailbox with mailbox_uuid; omit it to aggregate across every mailbox assigned to the caller. |
verifyAppPassword |
mail:query:verifyAppPassword |
Validates an address + app password pair. Restricted to service tokens (the IMAP/SMTP gateway); grant: mail:query:verifyAppPassword. Marks the credential as used when valid. |
Mutations
Section titled “Mutations”| Operation | Required permission | Description |
|---|---|---|
addMailboxDelegate |
mail:mutation:addMailboxDelegate |
Grant another org member delegate access to one of the caller’s mailboxes. |
addSenderRule |
mail:mutation:addSenderRule |
Add an allow/block sender rule (full address or bare domain, subdomains included). With mailbox_uuid it is personal; without, org-wide (ROLE_ADMIN). Blocked senders go straight to Trash; allowed senders bypass spam filtering. |
applyLabel |
mail:mutation:applyLabel |
Attach a label to messages in the caller’s mailboxes. |
cancelSend |
mail:mutation:cancelSend |
Undo send / cancel a scheduled send: turns a still-QUEUED message back into a draft. Works during the mailbox’s undo window and any time before a scheduled message is released. |
createAlias |
mail:mutation:createAlias |
Create a send-as alias on one of the caller’s mailboxes. The alias’s domain must be verified in settings; mail to the alias delivers to the mailbox and messages can be sent as it (SendEmailInput.alias_uuid). |
createAppPassword |
mail:mutation:createAppPassword |
Create an app password for a local IMAP/SMTP client. The plaintext secret is returned exactly once and stored only as a hash. |
createForwarder |
mail:mutation:createForwarder |
Create an auto-forwarder. Destinations on the org’s own domains activate immediately; external destinations receive a confirmation email and only start forwarding once confirmed (and only while org policy allows external forwarding). |
createLabel |
mail:mutation:createLabel |
Create a custom label in one of the caller’s mailboxes. |
createMailbox |
mail:mutation:createMailbox |
Create a mailbox for an organization member. ROLE_ADMIN. The address’s domain must be verified in the settings app first. |
createMailFilter |
mail:mutation:createMailFilter |
Create a filter (rule). With mailbox_uuid it applies to that mailbox (caller must own it); without, it is an org-level rule applied to every mailbox first (ROLE_ADMIN). |
createMailTemplate |
mail:mutation:createMailTemplate |
Create a reusable message template in one of the caller’s mailboxes. |
deleteAlias |
mail:mutation:deleteAlias |
Delete an alias. |
deleteCatchAll |
mail:mutation:deleteCatchAll |
Remove a catch-all route. ROLE_ADMIN. |
deleteDraft |
mail:mutation:deleteDraft |
Delete a draft permanently. |
deleteEmailsForever |
mail:mutation:deleteEmailsForever |
Permanently delete messages that are already in TRASH or SPAM. Returns the deleted uuids. |
deleteForwarder |
mail:mutation:deleteForwarder |
Delete a forwarder. |
deleteLabel |
mail:mutation:deleteLabel |
Delete a label (detaches it from all messages). |
deleteMailFilter |
mail:mutation:deleteMailFilter |
Delete a filter. |
deleteMailTemplate |
mail:mutation:deleteMailTemplate |
Delete a template. |
deleteSenderRule |
mail:mutation:deleteSenderRule |
Delete a sender rule. |
moveEmails |
mail:mutation:moveEmails |
Move messages between folders (archive, trash, spam, back to inbox…). |
removeLabel |
mail:mutation:removeLabel |
Detach a label from messages. |
removeMailboxDelegate |
mail:mutation:removeMailboxDelegate |
Revoke delegate access. |
revokeAppPassword |
mail:mutation:revokeAppPassword |
Revoke an app password (existing sessions are cut off at the gateway). |
saveDraft |
mail:mutation:saveDraft |
Create or update a draft (pass draft_uuid to update). |
sendEmail |
mail:mutation:sendEmail |
Queue a message for delivery (all sending is asynchronous; the returned Email has status QUEUED, later SENT or FAILED). Humans send from a mailbox they own (mailbox_uuid, or their only mailbox by default); the message is threaded into thread_uuid when replying and lands in the SENT folder. Sending a draft: pass draft_uuid. Machine callers (IAM grant mail:mutation:sendEmail) pass from instead — any address on a domain the organization has verified in settings. |
setCatchAll |
mail:mutation:setCatchAll |
Route mail for unknown addresses on a verified domain to a mailbox. ROLE_ADMIN. |
setEmailsRead |
mail:mutation:setEmailsRead |
Mark messages read/unread. Caller must own the mailbox. |
setEmailsStarred |
mail:mutation:setEmailsStarred |
Star/unstar messages. Caller must own the mailbox. |
setMailboxUsers |
mail:mutation:setMailboxUsers |
Replace a mailbox’s user assignments (shared mailboxes are assigned to several users). At least one user must remain. ROLE_ADMIN. |
snoozeThread |
mail:mutation:snoozeThread |
Hide a thread until the given time (new replies un-snooze it early). |
unsnoozeThread |
mail:mutation:unsnoozeThread |
Bring a snoozed thread back now. |
unsubscribe |
mail:mutation:unsubscribe |
Unsubscribe from the sender of a received message. Performs an RFC 8058 one-click unsubscribe server-side when the message supports it; otherwise returns the link / mailto for the client to complete manually. |
updateForwarder |
mail:mutation:updateForwarder |
Pause/resume a forwarder or change what happens to the local copy. |
updateLabel |
mail:mutation:updateLabel |
Rename/recolor a label. Caller must own the mailbox. |
updateMailbox |
mail:mutation:updateMailbox |
Update display name / signature. Mailbox owner or ROLE_ADMIN. |
updateMailboxSettings |
mail:mutation:updateMailboxSettings |
Update vacation responder / undo-send settings of one of the caller’s mailboxes. |
updateMailFilter |
mail:mutation:updateMailFilter |
Update a filter. Mailbox owner, or ROLE_ADMIN for org-level filters. |
updateMailTemplate |
mail:mutation:updateMailTemplate |
Update a template. |
updateOrgMailPolicy |
mail:mutation:updateOrgMailPolicy |
Update the organization-wide mail policy. ROLE_ADMIN. |
Internal operations
Section titled “Internal operations”The following operations exist in the schema but are reserved for internal
suite automation (service tokens or suite operators) and are not available
to IAM credentials: applyAutomationAction, applyAutomationWorkflow.