{"openapi":"3.1.0","info":{"title":"Buffmailer API","description":"Read and send mail as a mailbox, and run an organization's domains, users, groups and aliases.\n\nAuthenticate with an API key from **Settings → API keys**: `Authorization: Bearer bm_live_…`. A key acts as the user who made it and carries scopes: `mail.read`, `mail.send`, `mail.modify`, and `admin` for organization resources (the user must be an owner or admin). Requests are limited per key by the plan's requests-per-minute; over it you get `429` with `Retry-After`.\n\nErrors are JSON: `{\"error\": {\"code\": \"send.recipient_invalid\", \"params\": {\"address\": \"…\"}}}`. The code is stable; `params` fills in the details.","license":{"name":"UNLICENSED","identifier":"UNLICENSED"},"version":"1"},"servers":[{"url":"https://buffmailer.com/api"}],"paths":{"/aliases":{"get":{"tags":["Aliases"],"summary":"List aliases","operationId":"list_aliases","responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Alias"}}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["admin"]}]},"post":{"tags":["Aliases"],"summary":"Create an alias","operationId":"create_alias","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewAlias"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AliasCreated"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["admin"]}]}},"/aliases/{address}":{"delete":{"tags":["Aliases"],"summary":"Delete an alias","operationId":"delete_alias","parameters":[{"name":"address","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["admin"]}]},"patch":{"tags":["Aliases"],"summary":"Point an alias at another user","operationId":"retarget_alias","parameters":[{"name":"address","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Retarget"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["admin"]}]}},"/contacts/suggest":{"get":{"tags":["Sending"],"summary":"Suggest recipients","description":"People in the directory and those the user has written to.","operationId":"suggest_contacts","parameters":[{"name":"q","in":"query","description":"What has been typed so far.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contacts"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["mail.read"]}]}},"/domains":{"get":{"tags":["Domains"],"summary":"List domains","operationId":"list_domains","responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DomainSummary"}}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["admin"]}]},"post":{"tags":["Domains"],"summary":"Add a domain","description":"Then add its `records` at the DNS host; it is checked every few minutes, or on `POST /domains/{id}/verify`.","operationId":"create_domain","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewDomain"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Created"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["admin"]}]}},"/domains/{id}":{"get":{"tags":["Domains"],"summary":"Get a domain","description":"The domain, the DNS records it needs and how the last check went.","operationId":"get_domain","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainDetail"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["admin"]}]},"delete":{"tags":["Domains"],"summary":"Remove a domain","description":"Only once it has no users, groups or aliases.","operationId":"delete_domain","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["admin"]}]},"patch":{"tags":["Domains"],"summary":"Set a domain's catch-all address","operationId":"update_domain","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainUpdate"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainDetail"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["admin"]}]}},"/domains/{id}/verify":{"post":{"tags":["Domains"],"summary":"Check a domain's DNS now","operationId":"verify_domain","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainDetail"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["admin"]}]}},"/drafts":{"get":{"tags":["Drafts"],"summary":"List drafts","operationId":"list_drafts","parameters":[{"name":"scheduled","in":"query","description":"List the drafts waiting to send, soonest first, instead of the others.","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DraftList"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["mail.send"]}]},"post":{"tags":["Drafts"],"summary":"Create a draft","operationId":"create_draft","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DraftInput"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Draft"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["mail.send"]}]}},"/drafts/{id}":{"get":{"tags":["Drafts"],"summary":"Get a draft","operationId":"get_draft","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Draft"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["mail.send"]}]},"put":{"tags":["Drafts"],"summary":"Replace a draft","description":"Not while it's scheduled; cancel the send first.","operationId":"save_draft","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DraftInput"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Draft"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["mail.send"]}]},"delete":{"tags":["Drafts"],"summary":"Delete a draft","operationId":"delete_draft","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["mail.send"]}]}},"/drafts/{id}/cancel":{"post":{"tags":["Drafts"],"summary":"Cancel a scheduled send","description":"The draft stays, unscheduled. Fails with `draft.sending` once it's going out.","operationId":"cancel_draft","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Draft"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["mail.send"]}]}},"/drafts/{id}/send":{"post":{"tags":["Drafts"],"summary":"Send a draft","description":"Now with no body, or later with `send_at` or `delay`. A scheduled send that fails at its time puts the draft back with\n`send_error`, and a notice lands in the inbox.","operationId":"send_draft","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/SendLater"}]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DraftSent"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["mail.send"]}]}},"/filters":{"get":{"tags":["Filters"],"summary":"List filters","operationId":"list_filters","responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FilterList"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["mail.read"]}]},"post":{"tags":["Filters"],"summary":"Create a filter","description":"Up to 200. It applies to mail arriving from now on, and to the mail already here with `apply_existing`.","operationId":"create_filter","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FilterInput"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FilterSaved"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["mail.modify"]}]}},"/filters/preview":{"post":{"tags":["Filters"],"summary":"Preview a filter","description":"How many conversations already here the criteria match.","operationId":"preview_filter","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FilterPreviewRequest"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FilterPreview"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["mail.read"]}]}},"/filters/{id}":{"get":{"tags":["Filters"],"summary":"Get a filter","operationId":"get_filter","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Filter"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["mail.read"]}]},"put":{"tags":["Filters"],"summary":"Replace a filter","operationId":"update_filter","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FilterInput"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FilterSaved"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["mail.modify"]}]},"delete":{"tags":["Filters"],"summary":"Delete a filter","operationId":"delete_filter","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["mail.modify"]}]}},"/groups":{"get":{"tags":["Groups"],"summary":"List groups","operationId":"list_groups","responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Group"}}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["admin"]}]},"post":{"tags":["Groups"],"summary":"Create a group","operationId":"create_group","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewGroup"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupCreated"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["admin"]}]}},"/groups/{id}":{"get":{"tags":["Groups"],"summary":"Get a group and its members","operationId":"get_group","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupDetail"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["admin"]}]},"delete":{"tags":["Groups"],"summary":"Delete a group","operationId":"delete_group","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["admin"]}]},"patch":{"tags":["Groups"],"summary":"Update a group","operationId":"update_group","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupPatch"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupDetail"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["admin"]}]}},"/groups/{id}/members":{"post":{"tags":["Groups"],"summary":"Add members","operationId":"add_members","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Members"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Added"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["admin"]}]}},"/groups/{id}/members/{address}":{"delete":{"tags":["Groups"],"summary":"Remove a member","operationId":"remove_member","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"address","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["admin"]}]}},"/labels":{"get":{"tags":["Labels"],"summary":"List labels","description":"System and user labels, with thread counts.","operationId":"list_labels","responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LabelList"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["mail.read"]}]},"post":{"tags":["Labels"],"summary":"Create a label","operationId":"create_label","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewLabel"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Label"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["mail.modify"]}]}},"/labels/{id}":{"delete":{"tags":["Labels"],"summary":"Delete a label","description":"The mail stays; only the label goes.","operationId":"delete_label","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["mail.modify"]}]},"patch":{"tags":["Labels"],"summary":"Rename or recolor a label","operationId":"update_label","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LabelPatch"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Label"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["mail.modify"]}]}},"/me":{"get":{"tags":["Account"],"summary":"The key's mailbox","description":"The user, their organization and plan, and the addresses they can send from.","operationId":"me","responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":[]}]}},"/messages":{"get":{"tags":["Messages"],"summary":"List messages","operationId":"list_messages","parameters":[{"name":"label","in":"query","description":"`INBOX`, `SENT`, `STARRED`, `IMPORTANT`, `SPAM`, `TRASH`, `UNREAD`, or a label id. Everything but spam and trash when absent.","required":false,"schema":{"type":"string"}},{"name":"q","in":"query","description":"A search, Gmail-style: `from:ann to:bob subject:invoice has:attachment is:unread is:starred label:clients in:sent\nbefore:2026-01-31 after:2025-12-01 \"exact phrase\"`; other words match the text.","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"1 to 100; 50 by default.","required":false,"schema":{"type":"integer","format":"int64"}},{"name":"before","in":"query","description":"From the previous page's `next`.","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"before_id","in":"query","description":"From the previous page's `next`.","required":false,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessagePage"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["mail.read"]}]}},"/messages/{id}":{"get":{"tags":["Messages"],"summary":"Get a message","operationId":"get_message","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"images","in":"query","description":"Load remote images (through the image proxy) instead of blocking them.","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["mail.read"]}]},"delete":{"tags":["Messages"],"summary":"Trash a message","operationId":"trash_message","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["mail.modify"]}]}},"/messages/{id}/attachments/{part}":{"get":{"tags":["Messages"],"summary":"Download an attachment","operationId":"attachment","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"part","in":"path","description":"The attachment's `part`.","required":true,"schema":{"type":"integer","format":"int32"}},{"name":"inline","in":"query","description":"`Content-Disposition: inline` for types safe to show.","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"","content":{"application/octet-stream":{"schema":{"$ref":"#/components/schemas/Binary"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["mail.read"]}]}},"/messages/{id}/attachments/{part}/thumb":{"get":{"tags":["Messages"],"summary":"An image attachment's thumbnail","description":"A JPEG at most 480 pixels on its longer side. 404 when the attachment\nisn't an image one can be made of.","operationId":"attachment_thumb","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"part","in":"path","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"","content":{"image/jpeg":{"schema":{"$ref":"#/components/schemas/Binary"}}}},"404":{"description":"No thumbnail"},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["mail.read"]}]}},"/messages/{id}/modify":{"post":{"tags":["Messages"],"summary":"Label a message","operationId":"modify_message","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LabelChanges"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageLabels"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["mail.modify"]}]}},"/messages/{id}/raw":{"get":{"tags":["Messages"],"summary":"Raw message","description":"The message as it was received or sent (RFC 5322).","operationId":"raw_message","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"","content":{"message/rfc822":{"schema":{"$ref":"#/components/schemas/Binary"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["mail.read"]}]}},"/outbound":{"get":{"tags":["Delivery"],"summary":"The outbound queue","description":"One row per recipient, newest first, 100 a page.","operationId":"list_outbound","parameters":[{"name":"status","in":"query","description":"`queued`, `sending`, `sent`, `failed` or `cancelled`.","required":false,"schema":{"type":"string"}},{"name":"q","in":"query","description":"Matches the sender or recipient.","required":false,"schema":{"type":"string"}},{"name":"before","in":"query","description":"The last row's `created_at`, for the next page.","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"before_id","in":"query","description":"The last row's `id`.","required":false,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutboundPage"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["admin"]}]}},"/outbound/{id}/cancel":{"post":{"tags":["Delivery"],"summary":"Cancel a queued delivery","operationId":"cancel_outbound","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["admin"]}]}},"/outbound/{id}/retry":{"post":{"tags":["Delivery"],"summary":"Retry a delivery now","operationId":"retry_outbound","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["admin"]}]}},"/send":{"post":{"tags":["Sending"],"summary":"Send a message","description":"JSON with attachments as upload ids or base64, or `multipart/form-data` with the JSON in a `message` field and the files\nalongside: `curl -F message='{\"to\":[\"ann@acme.test\"],\"subject\":\"Hi\",\"text\":\"Hello\"}' -F file=@report.pdf`.\nCounts toward the plan's daily sending limit, per recipient.","operationId":"send","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendRequest"}},"multipart/form-data":{"schema":{"$ref":"#/components/schemas/SendForm"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Submitted"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["mail.send"]}]}},"/suppressions":{"get":{"tags":["Delivery"],"summary":"List suppressed addresses","description":"Addresses that bounced hard or complained; mail to them isn't sent.","operationId":"list_suppressions","responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Suppression"}}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["admin"]}]},"post":{"tags":["Delivery"],"summary":"Suppress an address","operationId":"add_suppression","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewSuppression"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["admin"]}]}},"/suppressions/{address}":{"delete":{"tags":["Delivery"],"summary":"Stop suppressing an address","operationId":"remove_suppression","parameters":[{"name":"address","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["admin"]}]}},"/threads":{"get":{"tags":["Threads"],"summary":"List threads","operationId":"list_threads","parameters":[{"name":"label","in":"query","description":"`INBOX`, `SENT`, `STARRED`, `IMPORTANT`, `SPAM`, `TRASH`, `UNREAD`, or a label id. Everything but spam and trash when absent.","required":false,"schema":{"type":"string"}},{"name":"q","in":"query","description":"A search, Gmail-style: `from:ann to:bob subject:invoice has:attachment is:unread is:starred label:clients in:sent\nbefore:2026-01-31 after:2025-12-01 \"exact phrase\"`; other words match the text.","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"1 to 100; 50 by default.","required":false,"schema":{"type":"integer","format":"int64"}},{"name":"before","in":"query","description":"From the previous page's `next`.","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"before_id","in":"query","description":"From the previous page's `next`.","required":false,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThreadPage"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["mail.read"]}]}},"/threads/empty":{"post":{"tags":["Threads"],"summary":"Empty trash or spam","operationId":"empty_label","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmptyLabel"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Emptied"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["mail.modify"]}]}},"/threads/modify":{"post":{"tags":["Threads"],"summary":"Label threads","operationId":"modify_threads","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThreadLabelChanges"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Touched"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["mail.modify"]}]}},"/threads/purge":{"delete":{"tags":["Threads"],"summary":"Delete threads for good","operationId":"purge_threads","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ids"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Deleted"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["mail.modify"]}]}},"/threads/snooze":{"post":{"tags":["Threads"],"summary":"Snooze threads","description":"Takes them out of the inbox (they get the `SNOOZED` label) until `until`, when they come back unread at the top.\nA reply arriving brings a thread back early.","operationId":"snooze_threads","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SnoozeRequest"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Touched"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["mail.modify"]}]}},"/threads/unsnooze":{"post":{"tags":["Threads"],"summary":"Unsnooze threads","description":"Back to the inbox now.","operationId":"unsnooze_threads","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ids"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Touched"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["mail.modify"]}]}},"/threads/{id}":{"get":{"tags":["Threads"],"summary":"Get a thread","operationId":"get_thread","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"label","in":"query","description":"The view it was opened from; `TRASH` and `SPAM` show only the messages there.","required":false,"schema":{"type":"string"}},{"name":"images","in":"query","description":"Load remote images instead of blocking them.","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Thread"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["mail.read"]}]},"delete":{"tags":["Threads"],"summary":"Trash a thread","description":"Moves it to trash, which empties itself after 30 days.","operationId":"trash_thread","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["mail.modify"]}]}},"/threads/{id}/modify":{"post":{"tags":["Threads"],"summary":"Label a thread","description":"Applies to every message in it.","operationId":"modify_thread","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LabelChanges"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Touched"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["mail.modify"]}]}},"/uploads":{"post":{"tags":["Sending"],"summary":"Upload an attachment","description":"Stage a file to attach by `upload_id`. Unused uploads are deleted after a day.","operationId":"upload","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/UploadForm"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Upload"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["mail.send"]}]}},"/uploads/from-message":{"post":{"tags":["Sending"],"summary":"Reuse a message's attachments","description":"Copies attachments of a message into uploads, for forwarding.","operationId":"upload_from_message","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FromMessage"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Upload"}}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["mail.send"]}]}},"/uploads/{id}":{"delete":{"tags":["Sending"],"summary":"Delete an upload","operationId":"delete_upload","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["mail.send"]}]}},"/users":{"get":{"tags":["Users"],"summary":"List users","operationId":"list_users","responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/User"}}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["admin"]}]},"post":{"tags":["Users"],"summary":"Create a user","operationId":"create_user","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewUser"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["admin"]}]}},"/users/{id}":{"get":{"tags":["Users"],"summary":"Get a user","operationId":"get_user","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["admin"]}]},"delete":{"tags":["Users"],"summary":"Delete a user","description":"Deletes their mail too. The organization's last owner can't be deleted.","operationId":"delete_user","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["admin"]}]},"patch":{"tags":["Users"],"summary":"Update a user","operationId":"update_user","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserPatch"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["admin"]}]}},"/webhooks":{"get":{"tags":["Webhooks"],"summary":"List webhooks","operationId":"list_webhooks","responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookList"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["admin"]}]},"post":{"tags":["Webhooks"],"summary":"Create a webhook","description":"The response has the signing secret; store it, it isn't shown again.","operationId":"create_webhook","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewWebhook"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookCreated"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["admin"]}]}},"/webhooks/{id}":{"get":{"tags":["Webhooks"],"summary":"Get a webhook","operationId":"get_webhook","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Webhook"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["admin"]}]},"delete":{"tags":["Webhooks"],"summary":"Delete a webhook","operationId":"delete_webhook","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["admin"]}]},"patch":{"tags":["Webhooks"],"summary":"Update a webhook","operationId":"update_webhook","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPatch"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Webhook"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["admin"]}]}},"/webhooks/{id}/deliveries":{"get":{"tags":["Webhooks"],"summary":"List deliveries","description":"Newest first, 50 a page, kept for 30 days.","operationId":"list_webhook_deliveries","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"status","in":"query","description":"`pending`, `delivered` or `failed`.","required":false,"schema":{"type":"string"}},{"name":"before","in":"query","description":"The previous page's `next`.","required":false,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliveryPage"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["admin"]}]}},"/webhooks/{id}/deliveries/{delivery}/retry":{"post":{"tags":["Webhooks"],"summary":"Redeliver","description":"Sends a delivery again, with a fresh set of retries.","operationId":"retry_webhook_delivery","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"delivery","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["admin"]}]}},"/webhooks/{id}/secret":{"post":{"tags":["Webhooks"],"summary":"Roll the signing secret","description":"The old secret stops working at once.","operationId":"roll_webhook_secret","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Secret"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["admin"]}]}},"/webhooks/{id}/test":{"post":{"tags":["Webhooks"],"summary":"Send a test event","description":"Queues a `ping` event to this endpoint.","operationId":"test_webhook","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestQueued"}}}},"4XX":{"description":"`error.code` says what went wrong; `params` has the details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"api_key":["admin"]}]}}},"components":{"schemas":{"Added":{"type":"object","required":["added"],"properties":{"added":{"type":"integer","format":"int64"}}},"Alias":{"type":"object","required":["address","user_id","user_address","domain_id","role","created_at"],"properties":{"address":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"domain_id":{"type":"string","format":"uuid"},"role":{"type":"boolean","description":"A role address like `postmaster@`."},"user_address":{"type":"string"},"user_id":{"type":"string","format":"uuid"}}},"AliasCreated":{"type":"object","required":["address"],"properties":{"address":{"type":"string"}}},"Attachment":{"type":"object","required":["part","filename","content_type","size","inline","url"],"properties":{"content_id":{"type":["string","null"]},"content_type":{"type":"string"},"filename":{"type":"string"},"inline":{"type":"boolean","description":"Shown in the body (`cid:`) rather than listed."},"part":{"type":"integer","format":"int32","description":"Its MIME part number."},"size":{"type":"integer","format":"int64"},"thumb_url":{"type":["string","null"],"description":"A small JPEG of an image attachment, when one can be made."},"url":{"type":"string","description":"Download link; needs the same authorization."}}},"AttachmentInput":{"oneOf":[{"type":"object","description":"A file from `POST /uploads`.","required":["upload_id"],"properties":{"upload_id":{"type":"string","format":"uuid"}}},{"type":"object","description":"The file itself.","required":["filename","content_base64"],"properties":{"content_base64":{"type":"string"},"content_type":{"type":["string","null"],"description":"Guessed from the filename when absent."},"filename":{"type":"string"}}}]},"Binary":{"type":"string","format":"binary","description":"Raw bytes."},"Contact":{"type":"object","required":["name","address","internal"],"properties":{"address":{"type":"string"},"internal":{"type":"boolean","description":"In this organization's directory."},"name":{"type":"string"}}},"Contacts":{"type":"object","required":["contacts"],"properties":{"contacts":{"type":"array","items":{"$ref":"#/components/schemas/Contact"}}}},"Created":{"type":"object","required":["id","name"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}}},"Cursor":{"type":"object","description":"Pass both values back to get the next page.","required":["before","before_id"],"properties":{"before":{"type":"string","format":"date-time"},"before_id":{"type":"string","format":"uuid"}}},"Deleted":{"type":"object","required":["deleted"],"properties":{"deleted":{"type":"integer","format":"int64"}}},"DeliveryPage":{"type":"object","required":["deliveries"],"properties":{"deliveries":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDelivery"}},"next":{"type":["integer","null"],"format":"int64"}}},"DnsRecord":{"type":"object","required":["kind","type","host","fqdn","value","required"],"properties":{"fqdn":{"type":"string"},"host":{"type":"string","description":"Relative to the zone: `@` or a label like `bm1._domainkey`."},"kind":{"type":"string","description":"`verify`, `mx`, `spf`, `dkim` or `dmarc`."},"priority":{"type":["integer","null"],"format":"int32"},"required":{"type":"boolean"},"type":{"type":"string","description":"`TXT` or `MX`."},"value":{"type":"string"}}},"Domain":{"type":"object","required":["id","org_id","name","status","verify_token","dkim_selector","dkim_public_key","checks","created_at"],"properties":{"catch_all":{"type":["string","null"],"description":"Gets mail sent to addresses the domain doesn't have."},"checked_at":{"type":["string","null"],"format":"date-time"},"checks":{"type":"object","description":"The last check: each record, whether it was found, and what was."},"created_at":{"type":"string","format":"date-time"},"dkim_public_key":{"type":"string"},"dkim_selector":{"type":"string"},"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"org_id":{"type":"string","format":"uuid"},"status":{"type":"string"},"verified_at":{"type":["string","null"],"format":"date-time"},"verify_token":{"type":"string","description":"Goes in the `buffmailer-verification=` TXT record."}}},"DomainDetail":{"type":"object","required":["domain","records","cloudflare","domain_connect","counts"],"properties":{"cloudflare":{"type":"object","description":"`dash_url`: the zone's DNS records in the Cloudflare dashboard."},"counts":{"type":"object"},"domain":{"$ref":"#/components/schemas/Domain"},"domain_connect":{"type":"object"},"expires_at":{"type":["string","null"],"format":"date-time","description":"When an unverified domain is released."},"records":{"type":"array","items":{"$ref":"#/components/schemas/DnsRecord"},"description":"What to add at the DNS host."}}},"DomainSummary":{"type":"object","required":["id","name","status","checks","created_at","users","groups"],"properties":{"checked_at":{"type":["string","null"],"format":"date-time"},"checks":{"type":"object"},"created_at":{"type":"string","format":"date-time"},"groups":{"type":"integer","format":"int64"},"id":{"type":"string","format":"uuid"},"mailbox":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/MailboxRef","description":"The mailbox the admin console opens for this domain: the one with the\ncaller's own local part, else the oldest. Never the caller's, nor the\nowner's for an admin."}]},"name":{"type":"string"},"status":{"type":"string","description":"`pending`, `verified` or `suspended`."},"users":{"type":"integer","format":"int64"},"verified_at":{"type":["string","null"],"format":"date-time"}}},"DomainUpdate":{"type":"object","properties":{"catch_all":{"type":["string","null"],"description":"A mailbox, alias or group of the domain (`info` or `info@acme.com`)\nthat gets mail sent to addresses the domain doesn't have. `null`\nturns it off: such mail bounces."}}},"DomainVerified":{"type":"object","description":"`domain.verified`: a domain's DNS checks passed.","required":["domain_id","name"],"properties":{"domain_id":{"type":"string","format":"uuid"},"name":{"type":"string"}}},"Draft":{"type":"object","required":["id","to","cc","bcc","subject","html","snippet","attachments","created_at","updated_at","sending"],"properties":{"attachments":{"type":"array","items":{"$ref":"#/components/schemas/Upload"}},"bcc":{"type":"array","items":{"type":"string"}},"cc":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string","format":"date-time"},"from":{"type":["string","null"]},"html":{"type":"string"},"id":{"type":"string","format":"uuid"},"in_reply_to":{"type":["string","null"],"format":"uuid"},"send_at":{"type":["string","null"],"format":"date-time","description":"When it's scheduled to send."},"send_error":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/SendError"}]},"sending":{"type":"boolean","description":"Going out right now."},"snippet":{"type":"string"},"subject":{"type":"string"},"thread_id":{"type":["string","null"],"format":"uuid"},"to":{"type":"array","items":{"type":"string"}},"updated_at":{"type":"string","format":"date-time"}}},"DraftInput":{"type":"object","properties":{"attachments":{"type":"array","items":{"type":"string","format":"uuid"},"description":"Upload ids."},"bcc":{"type":"array","items":{"type":"string"}},"cc":{"type":"array","items":{"type":"string"}},"from":{"type":["string","null"]},"html":{"type":"string"},"in_reply_to":{"type":["string","null"],"format":"uuid"},"subject":{"type":"string"},"to":{"type":"array","items":{"type":"string"}}},"example":{"to":["bob@example.com"],"subject":"Draft","html":"<p>Not done yet</p>","attachments":[]}},"DraftList":{"type":"object","required":["drafts"],"properties":{"drafts":{"type":"array","items":{"$ref":"#/components/schemas/DraftSummary"}}}},"DraftSent":{"oneOf":[{"$ref":"#/components/schemas/Submitted"},{"$ref":"#/components/schemas/Scheduled"}]},"DraftSummary":{"type":"object","required":["id","to","subject","snippet","attachments","updated_at"],"properties":{"attachments":{"type":"integer","format":"int64"},"id":{"type":"string","format":"uuid"},"send_at":{"type":["string","null"],"format":"date-time"},"send_error":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/SendError"}]},"snippet":{"type":"string"},"subject":{"type":"string"},"thread_id":{"type":["string","null"],"format":"uuid"},"to":{"type":"array","items":{"type":"string"}},"updated_at":{"type":"string","format":"date-time"}}},"Emptied":{"type":"object","required":["threads","messages"],"properties":{"messages":{"type":"integer","format":"int64"},"threads":{"type":"integer","format":"int64"}}},"EmptyLabel":{"type":"object","required":["label"],"properties":{"label":{"type":"string","description":"`TRASH` or `SPAM`."}},"example":{"label":"TRASH"}},"Error":{"type":"object","required":["error"],"properties":{"error":{"$ref":"#/components/schemas/ErrorDetail"}}},"ErrorDetail":{"type":"object","required":["code"],"properties":{"code":{"type":"string","description":"Stable and machine-readable, e.g. `send.recipient_invalid`."},"params":{"type":["object","null"]}}},"Filter":{"type":"object","required":["id","criteria","actions","created_at"],"properties":{"actions":{"$ref":"#/components/schemas/FilterActions"},"created_at":{"type":"string","format":"date-time"},"criteria":{"$ref":"#/components/schemas/FilterCriteria"},"id":{"type":"string","format":"uuid"}}},"FilterActions":{"type":"object","description":"At least one is needed.","properties":{"important":{"type":"boolean"},"label":{"type":["string","null"],"format":"uuid","description":"A user label id to add."},"mark_read":{"type":"boolean"},"never_spam":{"type":"boolean","description":"Take it out of spam."},"skip_inbox":{"type":"boolean","description":"Archive it."},"star":{"type":"boolean"},"trash":{"type":"boolean"}}},"FilterCriteria":{"type":"object","description":"Every field given must match; at least one is needed. Text fields are case-insensitive.","properties":{"from":{"type":"string","description":"Part of the sender's address or name; `a@x.test, b@y.test` or `|` or ` OR ` for any of several."},"has_attachment":{"type":"boolean"},"has_words":{"type":"string","description":"Words in the subject or body, all of them; `\"a phrase\"` and `OR` work."},"not_words":{"type":"string","description":"Words that must not appear."},"subject":{"type":"string","description":"Part of the subject; `|` or ` OR ` for any of several."},"to":{"type":"string","description":"Part of a To or Cc address or name, the same way."}}},"FilterInput":{"type":"object","required":["criteria","actions"],"properties":{"actions":{"$ref":"#/components/schemas/FilterActions"},"apply_existing":{"type":"boolean","description":"Also apply it to the mail already here (spam and trash aside), up to 10,000 messages."},"criteria":{"$ref":"#/components/schemas/FilterCriteria"}},"example":{"criteria":{"from":"billing@vendor.test"},"actions":{"skip_inbox":true,"mark_read":true},"apply_existing":true}},"FilterList":{"type":"object","required":["filters"],"properties":{"filters":{"type":"array","items":{"$ref":"#/components/schemas/Filter"}}}},"FilterPreview":{"type":"object","required":["threads","more"],"properties":{"more":{"type":"boolean","description":"There are more than 1,000."},"threads":{"type":"integer","format":"int64","description":"Conversations already here it matches, up to 1,000."}}},"FilterPreviewRequest":{"type":"object","required":["criteria"],"properties":{"criteria":{"$ref":"#/components/schemas/FilterCriteria"}}},"FilterSaved":{"type":"object","required":["id","criteria","actions","created_at","applied"],"properties":{"actions":{"$ref":"#/components/schemas/FilterActions"},"applied":{"type":"integer","format":"int64","description":"Threads changed by `apply_existing`."},"created_at":{"type":"string","format":"date-time"},"criteria":{"$ref":"#/components/schemas/FilterCriteria"},"id":{"type":"string","format":"uuid"}}},"FromMessage":{"type":"object","required":["message_id"],"properties":{"message_id":{"type":"string","format":"uuid"},"parts":{"type":["array","null"],"items":{"type":"integer","format":"int32"},"description":"Attachment part numbers; all non-inline attachments when absent."}}},"Group":{"type":"object","required":["id","address","name","description","who_can_post","domain_id","members","created_at"],"properties":{"address":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"description":{"type":"string"},"domain_id":{"type":"string","format":"uuid"},"id":{"type":"string","format":"uuid"},"members":{"type":"integer","format":"int64"},"name":{"type":"string"},"who_can_post":{"type":"string","description":"`anyone`, `org` or `members`."}}},"GroupCreated":{"type":"object","required":["id","address","members_added"],"properties":{"address":{"type":"string"},"id":{"type":"string","format":"uuid"},"members_added":{"type":"integer","format":"int64"}}},"GroupDetail":{"type":"object","required":["group","members"],"properties":{"group":{"$ref":"#/components/schemas/Group"},"members":{"type":"array","items":{"$ref":"#/components/schemas/Member"}}}},"GroupPatch":{"type":"object","properties":{"description":{"type":["string","null"]},"name":{"type":["string","null"]},"who_can_post":{"type":["string","null"]}}},"Ids":{"type":"object","required":["ids"],"properties":{"ids":{"type":"array","items":{"type":"string","format":"uuid"},"description":"Up to 500."}}},"Label":{"type":"object","required":["id","name","created_at"],"properties":{"color":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"},"id":{"type":"string","format":"uuid"},"name":{"type":"string"}}},"LabelChanges":{"type":"object","description":"Label names to add and remove: system labels (`UNREAD`, `STARRED`, `INBOX`, `TRASH`, `SPAM`, …) or label ids.\nArchiving removes `INBOX`; trashing adds `TRASH`.","properties":{"add":{"type":"array","items":{"type":"string"},"default":[]},"remove":{"type":"array","items":{"type":"string"},"default":[]}},"example":{"add":["STARRED"],"remove":["INBOX","UNREAD"]}},"LabelCount":{"type":"object","required":["id","name","system","unread","threads"],"properties":{"color":{"type":["string","null"]},"id":{"type":"string","description":"`INBOX`, `SENT`, … for system labels, a UUID for the user's."},"name":{"type":"string"},"system":{"type":"boolean"},"threads":{"type":"integer","format":"int64"},"unread":{"type":"integer","format":"int64","description":"Unread threads."}}},"LabelList":{"type":"object","required":["labels","drafts","scheduled"],"properties":{"drafts":{"type":"integer","format":"int64","description":"Drafts not scheduled to send."},"labels":{"type":"array","items":{"$ref":"#/components/schemas/LabelCount"}},"scheduled":{"type":"integer","format":"int64","description":"Drafts waiting to send."}}},"LabelPatch":{"type":"object","properties":{"color":{"type":["string","null"],"description":"`null` clears it."},"name":{"type":["string","null"]}}},"Mailbox":{"type":"object","required":["name","address"],"properties":{"address":{"type":"string"},"name":{"type":"string","description":"`\"\"` when the address has no display name."}}},"MailboxRef":{"type":"object","required":["id","address"],"properties":{"address":{"type":"string"},"id":{"type":"string","format":"uuid"}}},"Me":{"type":"object","required":["id","address","name","role","staff","org","signature","storage_used","addresses","two_factor","two_factor_required","two_factor_owed","undo_send_seconds","mail_host","via"],"properties":{"address":{"type":"string"},"addresses":{"type":"array","items":{"type":"string"},"description":"The user's address and aliases; any can be a `from`."},"id":{"type":"string","format":"uuid"},"mail_host":{"type":"string","description":"The IMAP and SMTP host."},"name":{"type":"string"},"org":{"$ref":"#/components/schemas/OrgSummary"},"quota_bytes":{"type":["integer","null"],"format":"int64"},"recovery_email":{"type":["string","null"]},"role":{"type":"string","description":"`owner`, `admin` or `member`."},"signature":{"type":"string","description":"HTML."},"staff":{"type":"boolean"},"storage_used":{"type":"integer","format":"int64"},"two_factor":{"type":"boolean"},"two_factor_owed":{"type":"boolean","description":"This browser session gets `403 2fa.required` everywhere but `/me`\nuntil `two_factor` is on. Never for sessions an org admin opened from\nthe admin console."},"two_factor_required":{"type":"boolean","description":"The platform requires an authenticator on every mailbox."},"undo_send_seconds":{"type":"integer","format":"int32","description":"Seconds the web app holds a sent message so it can be undone."},"vacation":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/VacationOn","description":"Set while the vacation reply is on."}]},"via":{"type":"string","description":"`api_key` for API keys."}}},"Member":{"type":"object","required":["address","kind","added_at"],"properties":{"added_at":{"type":"string","format":"date-time"},"address":{"type":"string"},"kind":{"type":"string","description":"`user`, `group`, `alias` or `external`."},"name":{"type":["string","null"]}}},"Members":{"type":"object","required":["addresses"],"properties":{"addresses":{"type":"array","items":{"type":"string"}}},"example":{"addresses":["carol@acme.com","partner@example.com"]}},"Message":{"type":"object","required":["id","thread_id","subject","snippet","from","to","cc","bcc","reply_to","labels","has_attachments","date","received_at","size","references","blocked_images","attachments"],"properties":{"attachments":{"type":"array","items":{"$ref":"#/components/schemas/Attachment"}},"auth":{"type":["object","null"],"description":"SPF, DKIM and DMARC results for received mail, e.g. `{\"spf\": \"pass\", \"dkim\": \"pass\", \"dmarc\": \"pass\"}`."},"bcc":{"type":"array","items":{"$ref":"#/components/schemas/Mailbox"},"description":"Only on mail this mailbox sent."},"blocked_images":{"type":"boolean","description":"Remote images were left out; ask again with `images=true`."},"cc":{"type":"array","items":{"$ref":"#/components/schemas/Mailbox"}},"date":{"type":"string","format":"date-time"},"from":{"$ref":"#/components/schemas/Mailbox"},"has_attachments":{"type":"boolean"},"html":{"type":["string","null"],"description":"Sanitized HTML, safe to show in a sandboxed frame. `null` on older messages of a long thread; fetch the message."},"id":{"type":"string","format":"uuid"},"in_reply_to":{"type":["string","null"]},"labels":{"type":"array","items":{"type":"string"}},"list_unsubscribe":{"type":["string","null"],"description":"An `https:` or `mailto:` unsubscribe link."},"message_id":{"type":["string","null"],"description":"The `Message-ID` header."},"received_at":{"type":"string","format":"date-time"},"references":{"type":"array","items":{"type":"string"}},"reply_to":{"type":"array","items":{"$ref":"#/components/schemas/Mailbox"}},"size":{"type":"integer","format":"int64"},"snippet":{"type":"string"},"spam_score":{"type":["number","null"],"format":"double"},"subject":{"type":"string"},"text":{"type":["string","null"],"description":"The plain-text body, on `GET /messages/{id}`."},"thread_id":{"type":"string","format":"uuid"},"to":{"type":"array","items":{"$ref":"#/components/schemas/Mailbox"}}}},"MessageBounced":{"type":"object","description":"`message.bounced`: a recipient's server refused it for good.","required":["from","recipient"],"properties":{"code":{"type":["integer","null"],"format":"int32"},"error":{"type":["string","null"]},"from":{"type":"string"},"message_id":{"type":["string","null"],"format":"uuid"},"recipient":{"type":"string"},"remote_host":{"type":["string","null"]}}},"MessageLabels":{"type":"object","required":["id","labels"],"properties":{"id":{"type":"string","format":"uuid"},"labels":{"type":"array","items":{"type":"string"}}}},"MessagePage":{"type":"object","required":["messages"],"properties":{"messages":{"type":"array","items":{"$ref":"#/components/schemas/MessageSummary"}},"next":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/Cursor"}]}}},"MessageReceived":{"type":"object","description":"`message.received`: new mail arrived in a mailbox, including mail a filter archived (spam and trash don't count).","required":["user_id","message_id","thread_id","subject","from","to","snippet"],"properties":{"from":{"$ref":"#/components/schemas/Mailbox"},"message_id":{"type":"string","format":"uuid"},"snippet":{"type":"string"},"subject":{"type":"string"},"thread_id":{"type":"string","format":"uuid"},"to":{"type":"array","items":{"$ref":"#/components/schemas/Mailbox"}},"user_id":{"type":"string","format":"uuid"}}},"MessageSent":{"type":"object","description":"`message.sent`: a mailbox sent mail, by API, web or SMTP.","required":["user_id","message_id","thread_id","from","subject","recipients","failed"],"properties":{"failed":{"type":"array","items":{"type":"string"},"description":"Recipients refused outright."},"from":{"type":"string"},"message_id":{"type":"string","format":"uuid"},"recipients":{"type":"array","items":{"type":"string"}},"subject":{"type":"string"},"thread_id":{"type":"string","format":"uuid"},"user_id":{"type":"string","format":"uuid"}}},"MessageSummary":{"type":"object","required":["id","thread_id","subject","snippet","from","to","cc","labels","has_attachments","date","received_at","size"],"properties":{"cc":{"type":"array","items":{"$ref":"#/components/schemas/Mailbox"}},"date":{"type":"string","format":"date-time","description":"The `Date` header, or when it arrived."},"from":{"$ref":"#/components/schemas/Mailbox"},"has_attachments":{"type":"boolean"},"id":{"type":"string","format":"uuid"},"labels":{"type":"array","items":{"type":"string"}},"received_at":{"type":"string","format":"date-time"},"size":{"type":"integer","format":"int64"},"snippet":{"type":"string"},"subject":{"type":"string"},"thread_id":{"type":"string","format":"uuid"},"to":{"type":"array","items":{"$ref":"#/components/schemas/Mailbox"}}}},"NewAlias":{"type":"object","required":["local_part","domain_id","user_id"],"properties":{"domain_id":{"type":"string","format":"uuid"},"local_part":{"type":"string"},"user_id":{"type":"string","format":"uuid"}},"example":{"local_part":"billing","domain_id":"0190c9a4-5b2e-7c41-9a3d-2f6e8b1c4d7a","user_id":"0190c9a4-6d1f-7a02-8b4e-3c5d9e0f1a2b"}},"NewDomain":{"type":"object","required":["name"],"properties":{"name":{"type":"string","description":"e.g. `acme.com`."}},"example":{"name":"acme.com"}},"NewGroup":{"type":"object","required":["local_part","domain_id","name"],"properties":{"description":{"type":["string","null"]},"domain_id":{"type":"string","format":"uuid"},"local_part":{"type":"string"},"members":{"type":["array","null"],"items":{"type":"string"},"description":"Addresses inside or outside the organization."},"name":{"type":"string"},"who_can_post":{"type":["string","null"],"description":"`org` by default."}},"example":{"local_part":"sales","domain_id":"0190c9a4-5b2e-7c41-9a3d-2f6e8b1c4d7a","name":"Sales","who_can_post":"anyone","members":["ann@acme.com","bob@acme.com"]}},"NewLabel":{"type":"object","required":["name"],"properties":{"color":{"type":["string","null"],"description":"A hex color like `#1a73e8`."},"name":{"type":"string","description":"Up to 100 characters; `/` nests, e.g. `Clients/Acme`."}},"example":{"name":"Clients/Acme","color":"#1a73e8"}},"NewSuppression":{"type":"object","required":["address"],"properties":{"address":{"type":"string"},"reason":{"type":["string","null"]}},"example":{"address":"old@example.com","reason":"Asked to stop"}},"NewUser":{"type":"object","required":["local_part","domain_id","name","password"],"properties":{"domain_id":{"type":"string","format":"uuid","description":"A verified domain."},"local_part":{"type":"string"},"name":{"type":"string"},"password":{"type":"string","description":"At least 10 characters."},"quota_bytes":{"type":["integer","null"],"format":"int64"},"recovery_email":{"type":["string","null"]},"role":{"type":["string","null"],"description":"`member` (default), `admin` or `owner`."}},"example":{"local_part":"bob","domain_id":"0190c9a4-5b2e-7c41-9a3d-2f6e8b1c4d7a","name":"Bob Jones","password":"a long enough password"}},"NewWebhook":{"type":"object","required":["url","events"],"properties":{"events":{"type":"array","items":{"type":"string"},"description":"`message.received`, `message.sent`, `message.bounced`, `domain.verified`, or `*`."},"url":{"type":"string","description":"HTTPS, on a public host."}},"example":{"url":"https://hooks.acme.com/buffmailer","events":["message.received","message.bounced"]}},"Ok":{"type":"object","required":["ok"],"properties":{"ok":{"type":"boolean"}}},"OrgSummary":{"type":"object","required":["id","name","plan","storage_used","suspended"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"plan":{"$ref":"#/components/schemas/Plan"},"storage_used":{"type":"integer","format":"int64"},"suspended":{"type":"boolean"}}},"Outbound":{"type":"object","required":["id","mail_from","rcpt","status","attempts","next_attempt_at","expires_at","created_at","updated_at"],"properties":{"attempts":{"type":"integer","format":"int32"},"created_at":{"type":"string","format":"date-time"},"expires_at":{"type":"string","format":"date-time","description":"It gives up then."},"id":{"type":"string","format":"uuid"},"last_code":{"type":["integer","null"],"format":"int32","description":"The last SMTP reply code."},"last_error":{"type":["string","null"]},"mail_from":{"type":"string"},"message_id":{"type":["string","null"],"format":"uuid"},"next_attempt_at":{"type":"string","format":"date-time"},"rcpt":{"type":"string"},"remote_host":{"type":["string","null"]},"status":{"type":"string"},"subject":{"type":["string","null"]},"updated_at":{"type":"string","format":"date-time"}}},"OutboundPage":{"type":"object","required":["deliveries","more"],"properties":{"deliveries":{"type":"array","items":{"$ref":"#/components/schemas/Outbound"}},"more":{"type":"boolean","description":"Another page follows."}}},"Participant":{"type":"object","required":["name","address","unread"],"properties":{"address":{"type":"string"},"name":{"type":"string"},"unread":{"type":"boolean","description":"Has an unread message from them."}}},"Plan":{"type":"object","required":["id","name","price_usd","storage_bytes","max_attachment_bytes","max_link_bytes","daily_send_limit","api_rpm","webhooks"],"properties":{"api_rpm":{"type":"integer","format":"int64","description":"API requests per minute, per key."},"daily_send_limit":{"type":"integer","format":"int64"},"id":{"type":"string"},"max_attachment_bytes":{"type":"integer","format":"int64"},"max_domains":{"type":["integer","null"],"format":"int64"},"max_groups":{"type":["integer","null"],"format":"int64"},"max_link_bytes":{"type":"integer","format":"int64","description":"The largest file one link can carry."},"max_users":{"type":["integer","null"],"format":"int64"},"name":{"type":"string"},"price_usd":{"type":"string","description":"Per month, as a decimal string."},"storage_bytes":{"type":"integer","format":"int64"},"webhooks":{"type":"boolean"}}},"Recipient":{"oneOf":[{"type":"string"},{"$ref":"#/components/schemas/Mailbox"}],"description":"`\"ann@acme.test\"`, `\"Ann <ann@acme.test>\"` or `{\"name\": \"Ann\", \"address\": \"ann@acme.test\"}`."},"Retarget":{"type":"object","required":["user_id"],"properties":{"user_id":{"type":"string","format":"uuid"}}},"Scheduled":{"type":"object","required":["scheduled","draft_id","send_at"],"properties":{"draft_id":{"type":"string","format":"uuid"},"scheduled":{"type":"boolean"},"send_at":{"type":"string","format":"date-time"}}},"Secret":{"type":"object","required":["secret"],"properties":{"secret":{"type":"string"}}},"SendError":{"type":"object","description":"Why a scheduled send didn't go; the draft is back in Drafts.","required":["code","params"],"properties":{"code":{"type":"string"},"params":{"type":"object"}}},"SendForm":{"type":"object","required":["message"],"properties":{"file":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Binary"},"description":"Any other file fields become attachments, named after the file."},"message":{"type":"string","description":"The `SendRequest` as JSON."}}},"SendLater":{"type":"object","description":"Empty, or one of `send_at` and `delay`, to send later.","properties":{"delay":{"type":["integer","null"],"format":"int32","description":"Seconds to hold it, up to 30, so it can be called back with `POST /drafts/{id}/cancel`.","minimum":0},"send_at":{"type":["string","null"],"format":"date-time","description":"At most a year out."}},"example":{"send_at":"2026-11-02T08:00:00Z"}},"SendRequest":{"type":"object","properties":{"attachments":{"type":"array","items":{"$ref":"#/components/schemas/AttachmentInput"}},"bcc":{"type":"array","items":{"$ref":"#/components/schemas/Recipient"}},"cc":{"type":"array","items":{"$ref":"#/components/schemas/Recipient"}},"draft_id":{"type":["string","null"],"format":"uuid","description":"A draft to delete once sent."},"from":{"type":["string","null"],"description":"One of the user's addresses (see `GET /me`); their own by default."},"html":{"type":["string","null"],"description":"HTML body; it is sanitized. A text part is made from it unless `text` is given."},"in_reply_to":{"type":["string","null"],"format":"uuid","description":"A message in this mailbox being answered: sets `In-Reply-To`, `References` and the thread."},"reply_to":{"type":"array","items":{"$ref":"#/components/schemas/Recipient"}},"subject":{"type":"string"},"text":{"type":["string","null"]},"to":{"type":"array","items":{"$ref":"#/components/schemas/Recipient"}}},"example":{"to":["Bob Jones <bob@example.com>"],"cc":[{"name":"Ann","address":"ann@acme.test"}],"subject":"Quarterly report","html":"<p>Hi Bob, the report is attached.</p>","attachments":[{"filename":"notes.txt","content_base64":"aGVsbG8="}]}},"SnoozeRequest":{"type":"object","required":["ids","until"],"properties":{"ids":{"type":"array","items":{"type":"string","format":"uuid"},"description":"Up to 500 thread ids."},"until":{"type":"string","format":"date-time","description":"In the future, at most a year out."}},"example":{"ids":["0190c9a4-5b2e-7c41-9a3d-2f6e8b1c4d7a"],"until":"2026-11-02T08:00:00Z"}},"Submitted":{"type":"object","required":["message_id","thread_id","delivered","queued","failed"],"properties":{"delivered":{"type":"integer","format":"int64","description":"Recipients in this organization, delivered at once."},"failed":{"type":"array","items":{"type":"string"},"description":"Recipients refused, e.g. suppressed or unknown."},"message_id":{"type":"string","format":"uuid"},"queued":{"type":"integer","format":"int64","description":"Recipients elsewhere, queued for delivery."},"thread_id":{"type":"string","format":"uuid"}}},"Suppression":{"type":"object","required":["address","reason","created_at"],"properties":{"address":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"reason":{"type":"string"}}},"TestQueued":{"type":"object","required":["delivery_id"],"properties":{"delivery_id":{"type":"integer","format":"int64"}}},"Thread":{"type":"object","required":["id","subject","labels","messages","hidden"],"properties":{"hidden":{"type":"integer","format":"int64","description":"Messages left out: those in trash or spam, unless opened from there."},"id":{"type":"string","format":"uuid"},"labels":{"type":"array","items":{"type":"string"}},"messages":{"type":"array","items":{"$ref":"#/components/schemas/Message"}},"snoozed_until":{"type":["string","null"],"format":"date-time"},"subject":{"type":"string"}}},"ThreadLabelChanges":{"type":"object","required":["ids"],"properties":{"add":{"type":"array","items":{"type":"string"}},"ids":{"type":"array","items":{"type":"string","format":"uuid"},"description":"Up to 500 thread ids."},"remove":{"type":"array","items":{"type":"string"}}},"example":{"ids":["0190c9a4-5b2e-7c41-9a3d-2f6e8b1c4d7a"],"add":["TRASH"],"remove":[]}},"ThreadPage":{"type":"object","required":["threads"],"properties":{"next":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/Cursor"}]},"threads":{"type":"array","items":{"$ref":"#/components/schemas/ThreadSummary"}}}},"ThreadSummary":{"type":"object","required":["id","subject","snippet","participants","to","messages","unread","starred","important","has_attachments","labels","last_message_at"],"properties":{"has_attachments":{"type":"boolean"},"id":{"type":"string","format":"uuid"},"important":{"type":"boolean"},"labels":{"type":"array","items":{"type":"string"},"description":"Labels on any of its messages."},"last_message_at":{"type":"string","format":"date-time","description":"The newest message in the view; in the inbox, also when it came back from a snooze."},"messages":{"type":"integer","format":"int64","description":"Messages in the view."},"participants":{"type":"array","items":{"$ref":"#/components/schemas/Participant"}},"snippet":{"type":"string"},"snoozed_until":{"type":["string","null"],"format":"date-time","description":"Out of the inbox until then."},"starred":{"type":"boolean"},"subject":{"type":"string"},"to":{"type":"array","items":{"$ref":"#/components/schemas/Mailbox"}},"unread":{"type":"boolean"}}},"Touched":{"type":"object","required":["threads"],"properties":{"threads":{"type":"array","items":{"type":"string","format":"uuid"}}}},"Upload":{"type":"object","required":["id","filename","content_type","size","created_at"],"properties":{"content_type":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"filename":{"type":"string"},"id":{"type":"string","format":"uuid"},"size":{"type":"integer","format":"int64"}}},"UploadForm":{"type":"object","required":["file"],"properties":{"file":{"$ref":"#/components/schemas/Binary"}}},"User":{"type":"object","required":["id","address","name","role","domain_id","storage_used","suspended","two_factor","created_at","aliases"],"properties":{"address":{"type":"string"},"aliases":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string","format":"date-time"},"domain_id":{"type":"string","format":"uuid"},"id":{"type":"string","format":"uuid"},"last_seen_at":{"type":["string","null"],"format":"date-time"},"name":{"type":"string"},"quota_bytes":{"type":["integer","null"],"format":"int64","description":"`null` uses the organization's storage."},"recovery_email":{"type":["string","null"]},"role":{"type":"string"},"storage_used":{"type":"integer","format":"int64"},"suspended":{"type":"boolean"},"two_factor":{"type":"boolean"}}},"UserPatch":{"type":"object","properties":{"name":{"type":["string","null"]},"password":{"type":["string","null"],"description":"Sets a new password and signs them out everywhere."},"quota_bytes":{"type":["integer","null"],"format":"int64","description":"`null` removes the cap."},"recovery_email":{"type":["string","null"]},"reset_two_factor":{"type":["boolean","null"],"description":"Removes their authenticator and signs them out everywhere; they set\nup a new one at their next sign-in. Browser sessions only."},"role":{"type":["string","null"]},"suspended":{"type":["boolean","null"],"description":"Suspended users can't sign in and get no mail."}}},"VacationOn":{"type":"object","properties":{"ends_at":{"type":["string","null"],"format":"date-time","description":"When it stops; `null` when it runs until turned off."}}},"Webhook":{"type":"object","required":["id","url","events","active","created_at","delivered_24h","retrying","failed_24h"],"properties":{"active":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"},"delivered_24h":{"type":"integer","format":"int64"},"events":{"type":"array","items":{"type":"string"},"description":"Event names, or `[\"*\"]` for all."},"failed_24h":{"type":"integer","format":"int64"},"id":{"type":"string","format":"uuid"},"last_delivery_at":{"type":["string","null"],"format":"date-time"},"retrying":{"type":"integer","format":"int64","description":"Waiting for another attempt."},"url":{"type":"string"}}},"WebhookCreated":{"allOf":[{"$ref":"#/components/schemas/Webhook"},{"type":"object","required":["secret"],"properties":{"secret":{"type":"string","description":"The signing secret. Shown only here and when rolled."}}}]},"WebhookDelivery":{"type":"object","required":["id","event","status","attempts","next_attempt_at","created_at","payload"],"properties":{"attempts":{"type":"integer","format":"int32"},"created_at":{"type":"string","format":"date-time"},"delivered_at":{"type":["string","null"],"format":"date-time"},"event":{"type":"string"},"id":{"type":"integer","format":"int64"},"last_error":{"type":["string","null"]},"last_status":{"type":["integer","null"],"format":"int32","description":"The endpoint's last HTTP status."},"next_attempt_at":{"type":"string","format":"date-time"},"payload":{"$ref":"#/components/schemas/WebhookEvent"},"status":{"type":"string","description":"`pending`, `delivered` or `failed`."}}},"WebhookEvent":{"type":"object","description":"The body of each webhook POST. Headers: `X-Buffmailer-Event`, `X-Buffmailer-Delivery` (an id; the same on retries) and\n`X-Buffmailer-Signature: t=<unix time>,v1=<hex HMAC-SHA256 of \"<t>.<body>\" keyed with the secret>`.","required":["event","org_id","created_at","data"],"properties":{"created_at":{"type":"string","format":"date-time"},"data":{"type":"object","description":"One of `MessageReceived`, `MessageSent`, `MessageBounced`, `DomainVerified`."},"event":{"type":"string","description":"`message.received`, `message.sent`, `message.bounced`, `domain.verified`, or `ping` from a test."},"org_id":{"type":"string","format":"uuid"}}},"WebhookList":{"type":"object","required":["webhooks","events","available"],"properties":{"available":{"type":"boolean","description":"The plan includes webhooks."},"events":{"type":"array","items":{"type":"string"},"description":"Events there are to subscribe to."},"webhooks":{"type":"array","items":{"$ref":"#/components/schemas/Webhook"}}}},"WebhookPatch":{"type":"object","properties":{"active":{"type":["boolean","null"]},"events":{"type":["array","null"],"items":{"type":"string"}},"url":{"type":["string","null"]}}}},"securitySchemes":{"api_key":{"type":"http","scheme":"bearer","bearerFormat":"bm_live_…","description":"An API key. Each operation lists the scope it needs."}}},"tags":[{"name":"Account","description":"The mailbox the key belongs to."},{"name":"Threads","description":"Conversations, as the web app shows them."},{"name":"Messages","description":"Single messages, their raw source and attachments."},{"name":"Labels","description":"System labels (`INBOX`, `SENT`, `TRASH`, …) and the user's own."},{"name":"Sending","description":"Send mail and stage attachments."},{"name":"Drafts","description":"Unsent messages. A draft can be sent now or at a set time."},{"name":"Filters","description":"Rules applied to incoming mail."},{"name":"Domains","description":"Needs the `admin` scope."},{"name":"Users","description":"Mailboxes in the organization. Needs the `admin` scope."},{"name":"Groups","description":"Addresses that deliver to their members. Needs the `admin` scope."},{"name":"Aliases","description":"Extra addresses for a user. Needs the `admin` scope."},{"name":"Delivery","description":"The outbound queue and the suppression list. Needs the `admin` scope."},{"name":"Webhooks","description":"Signed HTTPS callbacks for mail events. Needs the `admin` scope and a plan with webhooks."}]}