unread wins over everything else. folders: one folder name for IMAP and Outlook (a move; the email's id changes with its folder, the new one is gateway.email_id). On Gmail, the folder names (as folders lists them; a system label such as \Starred as it is) become the mail's labels: the ones named are added; of the others, only user labels and INBOX, Trash and Spam are removed. Important, Starred, Draft and Sent stay unless named; All Mail is no label.
Your API key from the console (gw_live_…).
In: header
Path Parameters
An email (emm_…), or the engine's own id (provider_id) with account_id.
Query Parameters
The mailbox (em_…): required with a provider id, else it must be the id's own.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X PUT "https://example.com/email/api/v1/emails/string" \ -H "Content-Type: application/json" \ -d '{}'{ "object": "EmailUpdated", "gateway": { "email_id": "string" }}Send an email POST
JSON, or multipart with each nested field (`to`, `cc`, `bcc`, `from`, `custom_headers`, `tracking_options`) as a JSON string and each attachment a file part. `custom_headers` may hold `X-*`, `List-Unsubscribe`, `List-Unsubscribe-Post`, `Reply-To`, `Content-Type` (text/plain makes a text-only mail) and, ours, `In-Reply-To` and `References`; anything else, or a line break, is 400 `errors/invalid_headers`. At most 500 recipients and 25 MB of attachments. `Idempotency-Key` makes a retry answer the first send (keys are per mailbox: the same key on two mailboxes is two sends). A mailbox that is not `OK` is still queued (`gateway.account_status` says its status). 404 means the mailbox is gone; a `reply_to` that names no mail is 422 `errors/parent_mail_not_found`.
Register an OAuth app POST
Swarmhit's own. The app the engine refreshes your Google or Microsoft mailboxes' tokens with (`kind: oauth`), or one that reaches a domain's mailboxes itself (`kind: service`: Google domain-wide delegation with `service_client` and `service_key`; Microsoft app-only with `tenant_id`). `route: api` uses the Gmail API / Graph, `imap` IMAP and SMTP. The secrets go to the engine only and are never answered.