{"openapi":"3.1.0","info":{"title":"Inboxwire API","version":"1.0.0","description":"Read, search and send mail across Gmail, Microsoft 365 and IMAP with one API. Authenticate with `Authorization: Bearer <key>`. Keys carry scopes: `read`, `send` (includes read) and `admin` (includes both). Pick the environment with the `x-environment` header (development, staging, production; default production). Errors are JSON: `{\"error\": \"code\"}`."},"servers":[{"url":"https://inboxwire.buffersoltech.com/v1"}],"tags":[{"name":"Accounts"},{"name":"Read"},{"name":"Send"},{"name":"Webhooks"}],"paths":{"/accounts":{"get":{"operationId":"listAccounts","tags":["Accounts"],"summary":"List accounts","description":"Mailboxes connected in the key's environment.","parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Account"}}},"required":["items"],"additionalProperties":false}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key's scope does not allow this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerAuth":["read"]}],"x-required-scope":"read"}},"/accounts/{id}":{"get":{"operationId":"getAccount","tags":["Accounts"],"summary":"Get an account","description":"State of one mailbox, including the last error and whether it runs on push or polling.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Account"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key's scope does not allow this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerAuth":["read"]}],"x-required-scope":"read"},"delete":{"operationId":"deleteAccount","tags":["Accounts"],"summary":"Delete an account","description":"Stops the provider watch, revokes the token where the provider supports it (Google), deletes the account, its credentials, cursors and queued sends, and writes a `deletion_record` (the address is kept only as a sha256). Needs the admin scope. Message content is never stored, so there is nothing else to remove.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Deletion"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key's scope does not allow this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerAuth":["admin"]}],"x-required-scope":"admin"}},"/usage":{"get":{"operationId":"getUsage","tags":["Accounts"],"summary":"Get usage","description":"Active mailboxes against the plan: used, included, extra and what the extras cost per month. The dashboard meter shows the same numbers.","parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Usage"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key's scope does not allow this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerAuth":["read"]}],"x-required-scope":"read"}},"/connect-links":{"post":{"operationId":"createConnectLink","tags":["Accounts"],"summary":"Create a connect link","description":"Single-use hosted connect page URL, valid for 24 hours. Opening it a second time returns 410. Needs the admin scope.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"externalId":{"type":"string","minLength":1,"maxLength":200},"redirectUrl":{"type":"string","maxLength":2048,"format":"uri"},"email":{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}}}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectLink"}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key's scope does not allow this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerAuth":["admin"]}],"x-required-scope":"admin"}},"/accounts/{id}/folders":{"get":{"operationId":"listFolders","tags":["Read"],"summary":"List folders","description":"Folders (IMAP, Microsoft) or labels (Gmail).","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Folder"}}},"required":["items"],"additionalProperties":false}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key's scope does not allow this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The mail provider failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerAuth":["read"]}],"x-required-scope":"read"}},"/accounts/{id}/messages":{"get":{"operationId":"listMessages","tags":["Read"],"summary":"List and search messages","description":"Newest first with cursor pagination. `q` accepts one syntax on every provider (from:, to:, subject:, after:, before:, has:attachment, bare words) and is translated to Gmail `q`, Graph `$filter`/`$search` or IMAP SEARCH.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"q","in":"query","required":false,"description":"Unified search: from: to: subject: after:YYYY-MM-DD before:YYYY-MM-DD has:attachment, bare words, \"quoted phrases\".","schema":{"type":"string","maxLength":500}},{"name":"folder","in":"query","required":false,"description":"Folder id from GET /folders.","schema":{"type":"string","maxLength":300}},{"name":"limit","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"description":"`nextCursor` from the previous page.","schema":{"type":"string","maxLength":4096}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessagePage"}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key's scope does not allow this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The mail provider failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerAuth":["read"]}],"x-required-scope":"read"}},"/accounts/{id}/messages/{mid}":{"get":{"operationId":"getMessage","tags":["Read"],"summary":"Get a message","description":"Metadata as JSON, or with `format=raw` the original RFC 822 source (`message/rfc822`). Bodies are fetched from the provider on request and never stored.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"mid","in":"path","required":true,"schema":{"type":"string"}},{"name":"format","in":"query","required":false,"schema":{"default":"json","type":"string","enum":["json","raw"]}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageSummary"}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key's scope does not allow this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The mail provider failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerAuth":["read"]}],"x-required-scope":"read"}},"/accounts/{id}/messages/{mid}/attachments":{"get":{"operationId":"listAttachments","tags":["Read"],"summary":"List attachments","description":"Attachment metadata of one message.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"mid","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Attachment"}}},"required":["items"],"additionalProperties":false}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key's scope does not allow this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The mail provider failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerAuth":["read"]}],"x-required-scope":"read"}},"/accounts/{id}/messages/{mid}/attachments/{aid}":{"get":{"operationId":"getAttachment","tags":["Read"],"summary":"Download an attachment","description":"The attachment bytes, always served as a download.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"mid","in":"path","required":true,"schema":{"type":"string"}},{"name":"aid","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The file","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key's scope does not allow this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The mail provider failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerAuth":["read"]}],"x-required-scope":"read"}},"/accounts/{id}/messages/send":{"post":{"operationId":"sendMessage","tags":["Send"],"summary":"Send a message","description":"Queues the message and answers 202 with the outbox id. Gmail and Microsoft send through their APIs, IMAP accounts through the mailbox's SMTP server. Send an `Idempotency-Key` header to make retries safe: for 7 days a repeat returns the original item with `Idempotent-Replayed: true`, and the same key with a different body returns 422.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Up to 255 printable ASCII characters. A repeat within 7 days returns the original result.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendRequest"}}}},"responses":{"202":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutboxItem"}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key's scope does not allow this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Unprocessable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerAuth":["send"]}],"x-required-scope":"send","x-causes-webhooks":["messageSent","messageFailed"]}},"/outbox/{id}":{"get":{"operationId":"getOutboxItem","tags":["Send"],"summary":"Get a queued send","description":"Status of a send: queued, sending, sent or failed.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutboxItem"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key's scope does not allow this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerAuth":["read"]}],"x-required-scope":"read"}},"/webhooks":{"get":{"operationId":"listWebhooks","tags":["Webhooks"],"summary":"List webhook endpoints","description":"Endpoints of the key's environment.","parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEndpoint"}}},"required":["items"],"additionalProperties":false}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key's scope does not allow this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerAuth":["admin"]}],"x-required-scope":"admin"},"post":{"operationId":"createWebhook","tags":["Webhooks"],"summary":"Create a webhook endpoint","description":"New endpoints subscribe to `messageNew` unless `events` is given. The response includes the signing secret once. Deliveries carry `Inboxwire-Signature: t=<unix>,v1=<hex>`, the HMAC-SHA256 of `<t>.<raw body>`.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","maxLength":2048,"format":"uri"},"events":{"default":["messageNew"],"description":"Event allowlist. Defaults to messageNew.","minItems":1,"maxItems":8,"type":"array","items":{"type":"string","enum":["messageNew","messageMoved","messageDeleted","messageSent","messageFailed","accountConnected","accountInitialized","accountError"]}}},"required":["url"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string","enum":["messageNew","messageMoved","messageDeleted","messageSent","messageFailed","accountConnected","accountInitialized","accountError"]}},"enabled":{"type":"boolean"},"failingSince":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"disabledAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"disabledReason":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"secret":{"type":"string"}},"required":["id","url","events","enabled","failingSince","disabledAt","disabledReason","createdAt","secret"],"additionalProperties":false}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key's scope does not allow this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerAuth":["admin"]}],"x-required-scope":"admin"}},"/webhooks/{id}":{"get":{"operationId":"getWebhook","tags":["Webhooks"],"summary":"Get a webhook endpoint","description":"One endpoint, including `failingSince` and why it was disabled.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key's scope does not allow this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerAuth":["admin"]}],"x-required-scope":"admin"},"patch":{"operationId":"updateWebhook","tags":["Webhooks"],"summary":"Update a webhook endpoint","description":"Change the URL, the event allowlist or `enabled`. Turning a disabled endpoint back on clears its failure clock.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","maxLength":2048,"format":"uri"},"events":{"minItems":1,"maxItems":8,"type":"array","items":{"type":"string","enum":["messageNew","messageMoved","messageDeleted","messageSent","messageFailed","accountConnected","accountInitialized","accountError"]}},"enabled":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key's scope does not allow this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerAuth":["admin"]}],"x-required-scope":"admin"},"delete":{"operationId":"deleteWebhook","tags":["Webhooks"],"summary":"Delete a webhook endpoint","description":"Stops all deliveries to the endpoint.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean"}},"required":["deleted"],"additionalProperties":false}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key's scope does not allow this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerAuth":["admin"]}],"x-required-scope":"admin"}},"/deliveries":{"get":{"operationId":"listDeliveries","tags":["Webhooks"],"summary":"List deliveries","description":"The delivery log: status, attempts, status code, latency and the start of the response of the last attempt. Failed deliveries retry with backoff for about 24 hours; an endpoint failing for 72 hours is disabled and the owners are emailed.","parameters":[{"name":"endpointId","in":"query","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["pending","succeeded","failed","retrying"]}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Delivery"}}},"required":["items"],"additionalProperties":false}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key's scope does not allow this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerAuth":["admin"]}],"x-required-scope":"admin"}},"/deliveries/{id}/replay":{"post":{"operationId":"replayDelivery","tags":["Webhooks"],"summary":"Replay a delivery","description":"Sends the stored payload again as a new delivery with the same event id. 409 when the endpoint is disabled.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"202":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Delivery"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key's scope does not allow this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerAuth":["admin"]}],"x-required-scope":"admin"}},"/deliveries/replay":{"post":{"operationId":"replayFailedDeliveries","tags":["Webhooks"],"summary":"Replay failed deliveries","description":"Bulk replay of failed deliveries that were not replayed yet, optionally for one endpoint.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"endpointId":{"type":"string"},"limit":{"default":100,"type":"integer","minimum":1,"maximum":100}}}}}},"responses":{"202":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"replayed":{"type":"number"},"succeeded":{"type":"number"},"skipped":{"type":"number"}},"required":["replayed","succeeded","skipped"],"additionalProperties":false}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key's scope does not allow this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerAuth":["admin"]}],"x-required-scope":"admin"}}},"webhooks":{"messageNew":{"post":{"summary":"messageNew","description":"Sent to endpoints that list `messageNew`. Verify `Inboxwire-Signature` before trusting it.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"2XX":{"description":"Return any 2xx within 10 seconds to acknowledge."}}}},"messageMoved":{"post":{"summary":"messageMoved","description":"Sent to endpoints that list `messageMoved`. Verify `Inboxwire-Signature` before trusting it.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"2XX":{"description":"Return any 2xx within 10 seconds to acknowledge."}}}},"messageDeleted":{"post":{"summary":"messageDeleted","description":"Sent to endpoints that list `messageDeleted`. Verify `Inboxwire-Signature` before trusting it.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"2XX":{"description":"Return any 2xx within 10 seconds to acknowledge."}}}},"messageSent":{"post":{"summary":"messageSent","description":"Sent to endpoints that list `messageSent`. Verify `Inboxwire-Signature` before trusting it.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"2XX":{"description":"Return any 2xx within 10 seconds to acknowledge."}}}},"messageFailed":{"post":{"summary":"messageFailed","description":"Sent to endpoints that list `messageFailed`. Verify `Inboxwire-Signature` before trusting it.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"2XX":{"description":"Return any 2xx within 10 seconds to acknowledge."}}}},"accountConnected":{"post":{"summary":"accountConnected","description":"Sent to endpoints that list `accountConnected`. Verify `Inboxwire-Signature` before trusting it.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"2XX":{"description":"Return any 2xx within 10 seconds to acknowledge."}}}},"accountInitialized":{"post":{"summary":"accountInitialized","description":"Sent to endpoints that list `accountInitialized`. Verify `Inboxwire-Signature` before trusting it.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"2XX":{"description":"Return any 2xx within 10 seconds to acknowledge."}}}},"accountError":{"post":{"summary":"accountError","description":"Sent to endpoints that list `accountError`. Verify `Inboxwire-Signature` before trusting it.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"2XX":{"description":"Return any 2xx within 10 seconds to acknowledge."}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"API key from Settings, API keys. `x-api-key` works too."}},"schemas":{"Account":{"type":"object","properties":{"id":{"type":"string"},"externalId":{"type":"string"},"email":{"type":"string"},"provider":{"type":"string","enum":["google","microsoft","imap"]},"backend":{"type":"string","enum":["gmail_api","graph","imap"]},"state":{"type":"string","enum":["connecting","syncing","connected","throttled","authenticationError","connectError"]},"lastError":{"type":["string","null"]},"mode":{"type":"string","enum":["push","polling"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","externalId","email","provider","backend","state","lastError","mode","createdAt"],"additionalProperties":false},"Deletion":{"type":"object","properties":{"deleted":{"type":"boolean","const":true},"deletionRecordId":{"type":"string"},"revocation":{"type":"string","enum":["revoked","not_applicable","failed"],"description":"Provider-side token revocation. Our copy of the credentials is deleted in every case."},"rows":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}}},"required":["deleted","deletionRecordId","revocation","rows"],"additionalProperties":false},"Usage":{"type":"object","properties":{"plan":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"mailboxes":{"type":"object","properties":{"used":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"included":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Mailboxes in the plan allowance"},"extra":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Mailboxes above the allowance, billed per extra mailbox"},"mode":{"type":"string","enum":["hard_cap","metered","unlimited"],"description":"hard_cap: connecting past the limit returns 402; metered: extras are billed; unlimited: no limit"},"extraPriceCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"estimatedExtraCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"level":{"type":"string","enum":["ok","near","over"]},"canAdd":{"type":"boolean"}},"required":["used","included","extra","mode","extraPriceCents","estimatedExtraCents","level","canAdd"],"additionalProperties":false},"environments":{"type":"object","properties":{"used":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["used","limit"],"additionalProperties":false}},"required":["plan","mailboxes","environments"],"additionalProperties":false},"ConnectLink":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"token":{"type":"string"},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"environment":{"type":"string"}},"required":["url","token","expiresAt","environment"],"additionalProperties":false},"Folder":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string","enum":["system","user"]},"unread":{"type":"number"},"total":{"type":"number"}},"required":["id","name","kind"],"additionalProperties":false},"MessagePage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/MessageSummary"}},"nextCursor":{"type":"string"}},"required":["items"],"additionalProperties":false},"MessageSummary":{"type":"object","properties":{"id":{"type":"string"},"threadId":{"type":"string"},"folder":{"type":"string"},"date":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"from":{"$ref":"#/components/schemas/Address"},"to":{"type":"array","items":{"$ref":"#/components/schemas/Address"}},"subject":{"type":"string"},"flags":{"type":"array","items":{"type":"string"}},"hasAttachments":{"type":"boolean"}},"required":["id","folder","date","to","subject","flags","hasAttachments"],"additionalProperties":false},"Address":{"type":"object","properties":{"name":{"type":"string","maxLength":200},"address":{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"required":["address"]},"Attachment":{"type":"object","properties":{"id":{"type":"string"},"filename":{"type":"string"},"contentType":{"type":"string"},"size":{"type":"number"},"inline":{"type":"boolean"}},"required":["id","filename","contentType","size"],"additionalProperties":false},"OutboxItem":{"type":"object","properties":{"id":{"type":"string"},"accountId":{"type":"string"},"status":{"type":"string","enum":["queued","sending","sent","failed"]},"attempts":{"type":"number"},"sendAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"messageId":{"type":"string"},"threadId":{"type":"string"},"error":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","accountId","status","attempts","sendAt","error","createdAt"],"additionalProperties":false},"SendRequest":{"type":"object","properties":{"to":{"minItems":1,"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/Address"}},"cc":{"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/Address"}},"bcc":{"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/Address"}},"subject":{"type":"string","maxLength":998},"html":{"type":"string","maxLength":2000000},"text":{"type":"string","maxLength":2000000},"replyToMessageId":{"description":"Provider message id to reply to. Gmail keeps the thread through In-Reply-To, References and threadId.","type":"string","maxLength":500},"sendAt":{"description":"Hold the message until this time (at most 30 days ahead).","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["to"]},"WebhookEndpoint":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string","enum":["messageNew","messageMoved","messageDeleted","messageSent","messageFailed","accountConnected","accountInitialized","accountError"]}},"enabled":{"type":"boolean"},"failingSince":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"disabledAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"disabledReason":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","url","events","enabled","failingSince","disabledAt","disabledReason","createdAt"],"additionalProperties":false},"Delivery":{"type":"object","properties":{"id":{"type":"string"},"eventId":{"type":"string"},"endpointId":{"type":"string"},"event":{"type":"string"},"status":{"type":"string","enum":["pending","succeeded","failed","retrying"]},"attempts":{"type":"number"},"nextAttemptAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"statusCode":{"type":["number","null"]},"error":{"type":["string","null"]},"latencyMs":{"type":["number","null"]},"responseSnippet":{"type":["string","null"]},"replayOf":{"type":["string","null"]},"replayedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","eventId","endpointId","event","status","attempts","nextAttemptAt","statusCode","error","latencyMs","responseSnippet","replayOf","replayedAt","createdAt"],"additionalProperties":false},"Error":{"type":"object","properties":{"error":{"type":"string"},"details":{}},"required":["error"],"additionalProperties":false},"WebhookEvent":{"type":"object","required":["id","type","created","data"],"properties":{"id":{"type":"string","description":"Event id. Stays the same on retries and replays."},"type":{"type":"string","enum":["messageNew","messageMoved","messageDeleted","messageSent","messageFailed","accountConnected","accountInitialized","accountError"]},"created":{"type":"integer","description":"Unix seconds"},"data":{"type":"object","additionalProperties":true}}}}}}