{"components":{"securitySchemes":{"ApiKeyAuth":{"in":"header","name":"X-API-KEY","type":"apiKey"}}},"info":{"description":"REST API for domains, accounts, mailboxes, messages, and tokens. Authenticate with an X-API-KEY header; stream new messages over SSE.","title":"smtp.dev \u2014 Email Testing API","version":"0.2.0"},"openapi":"3.0.0","paths":{"/api/accounts":{"get":{"description":"Retrieves the collection of Account resources. Supports exact address= and boolean isActive= filters and exposes storage_limit plus used_storage_bytes.","responses":{"200":{"description":"OK"},"401":{"description":"Unauthorized: missing or invalid X-API-KEY"},"404":{"description":"Not Found"},"422":{"description":"Unprocessable Entity"},"429":{"description":"Too Many Requests"}},"summary":"List Accounts"},"post":{"description":"Creates an Account resource. When an account is created, 5 default mailboxes are automatically created: INBOX, Sent, Trash, Drafts, and Junk. The address can receive mail immediately.","responses":{"200":{"description":"OK"},"401":{"description":"Unauthorized: missing or invalid X-API-KEY"},"404":{"description":"Not Found"},"422":{"description":"Unprocessable Entity"},"429":{"description":"Too Many Requests"}},"summary":"Create an Account"}},"/api/accounts/{account_id}":{"delete":{"description":"Deletes the Account resource. Deleted accounts can't be restored. Their mailboxes and messages are gone too.","responses":{"200":{"description":"OK"},"401":{"description":"Unauthorized: missing or invalid X-API-KEY"},"404":{"description":"Not Found"},"422":{"description":"Unprocessable Entity"},"429":{"description":"Too Many Requests"}},"summary":"Delete an Account"},"get":{"description":"Get an Account resource by its id.","responses":{"200":{"description":"OK"},"401":{"description":"Unauthorized: missing or invalid X-API-KEY"},"404":{"description":"Not Found"},"422":{"description":"Unprocessable Entity"},"429":{"description":"Too Many Requests"}},"summary":"Get an Account"},"patch":{"description":"Updates account activation, password, and storage quota fields.","responses":{"200":{"description":"OK"},"401":{"description":"Unauthorized: missing or invalid X-API-KEY"},"404":{"description":"Not Found"},"422":{"description":"Unprocessable Entity"},"429":{"description":"Too Many Requests"}},"summary":"Update an Account"}},"/api/accounts/{account_id}/mailboxes":{"get":{"description":"Gets all the Mailbox resources of a given account, including isSystem, totalMessages, and totalUnreadMessages.","responses":{"200":{"description":"OK"},"401":{"description":"Unauthorized: missing or invalid X-API-KEY"},"404":{"description":"Not Found"},"422":{"description":"Unprocessable Entity"},"429":{"description":"Too Many Requests"}},"summary":"List Mailboxes"},"post":{"description":"Creates a Mailbox resource for a given account.","responses":{"200":{"description":"OK"},"401":{"description":"Unauthorized: missing or invalid X-API-KEY"},"404":{"description":"Not Found"},"422":{"description":"Unprocessable Entity"},"429":{"description":"Too Many Requests"}},"summary":"Create a Mailbox"}},"/api/accounts/{account_id}/mailboxes/{mailbox_id}":{"delete":{"description":"Deletes a custom mailbox and cascades its messages. System mailboxes cannot be deleted.","responses":{"200":{"description":"OK"},"401":{"description":"Unauthorized: missing or invalid X-API-KEY"},"404":{"description":"Not Found"},"422":{"description":"Unprocessable Entity"},"429":{"description":"Too Many Requests"}},"summary":"Delete a Mailbox"},"patch":{"description":"Renames a mailbox path if the target path is unique in the account.","responses":{"200":{"description":"OK"},"401":{"description":"Unauthorized: missing or invalid X-API-KEY"},"404":{"description":"Not Found"},"422":{"description":"Unprocessable Entity"},"429":{"description":"Too Many Requests"}},"summary":"Update a Mailbox"}},"/api/accounts/{account_id}/mailboxes/{mailbox_id}/messages":{"get":{"description":"Lists messages in a mailbox, newest first. Supports page/limit pagination and a q= partial-match filter on subject, from, to, and text.","responses":{"200":{"description":"OK"},"401":{"description":"Unauthorized: missing or invalid X-API-KEY"},"404":{"description":"Not Found"},"422":{"description":"Unprocessable Entity"},"429":{"description":"Too Many Requests"}},"summary":"List Messages"}},"/api/accounts/{account_id}/mailboxes/{mailbox_id}/messages/{message_id}/download":{"get":{"description":"Downloads the raw RFC 5322 message as message.eml.","responses":{"200":{"description":"OK"},"401":{"description":"Unauthorized: missing or invalid X-API-KEY"},"404":{"description":"Not Found"},"422":{"description":"Unprocessable Entity"},"429":{"description":"Too Many Requests"}},"summary":"Download a Message"}},"/api/accounts/{account_id}/mailboxes/{mailbox_id}/messages/{message_id}/move":{"put":{"description":"Moves a message to another mailbox in the same account and returns the updated Message resource.","responses":{"200":{"description":"OK"},"401":{"description":"Unauthorized: missing or invalid X-API-KEY"},"404":{"description":"Not Found"},"422":{"description":"Unprocessable Entity"},"429":{"description":"Too Many Requests"}},"summary":"Move a Message"}},"/api/accounts/{account_id}/mailboxes/{mailbox_id}/messages/{message_id}/source":{"get":{"description":"Returns the raw RFC 5322 source wrapped as JSON.","responses":{"200":{"description":"OK"},"401":{"description":"Unauthorized: missing or invalid X-API-KEY"},"404":{"description":"Not Found"},"422":{"description":"Unprocessable Entity"},"429":{"description":"Too Many Requests"}},"summary":"Get Message Source"}},"/api/accounts/{account_id}/messages/send":{"post":{"description":"Sends a test email between sandbox accounts. Only addresses on domains owned by the same user are allowed.","responses":{"200":{"description":"OK"},"401":{"description":"Unauthorized: missing or invalid X-API-KEY"},"404":{"description":"Not Found"},"422":{"description":"Unprocessable Entity"},"429":{"description":"Too Many Requests"}},"summary":"Send a Message"}},"/api/domains":{"get":{"description":"You have to use this when creating an account, to retrieve the domain. Returns a list of domains.","responses":{"200":{"description":"OK"},"401":{"description":"Unauthorized: missing or invalid X-API-KEY"},"404":{"description":"Not Found"},"422":{"description":"Unprocessable Entity"},"429":{"description":"Too Many Requests"}},"summary":"List Domains"},"post":{"description":"Creates a Domain resource.","responses":{"200":{"description":"OK"},"401":{"description":"Unauthorized: missing or invalid X-API-KEY"},"404":{"description":"Not Found"},"422":{"description":"Unprocessable Entity"},"429":{"description":"Too Many Requests"}},"summary":"Create a Domain"}},"/api/domains/{domain_id}":{"delete":{"description":"Deletes a domain and cascades its accounts, mailboxes, messages, headers, and attachments.","responses":{"200":{"description":"OK"},"401":{"description":"Unauthorized: missing or invalid X-API-KEY"},"404":{"description":"Not Found"},"422":{"description":"Unprocessable Entity"},"429":{"description":"Too Many Requests"}},"summary":"Delete a Domain"},"patch":{"description":"Updates activation and verification fields. Accepts isActive/is_active as aliases for the current verified-active state.","responses":{"200":{"description":"OK"},"401":{"description":"Unauthorized: missing or invalid X-API-KEY"},"404":{"description":"Not Found"},"422":{"description":"Unprocessable Entity"},"429":{"description":"Too Many Requests"}},"summary":"Update a Domain"}},"/api/events":{"get":{"description":"Server-Sent Events stream of message.received and message.deleted events.","responses":{"200":{"description":"OK"},"401":{"description":"Unauthorized: missing or invalid X-API-KEY"},"404":{"description":"Not Found"},"422":{"description":"Unprocessable Entity"},"429":{"description":"Too Many Requests"}},"summary":"Stream Events"}},"/api/health":{"get":{"description":"Public health check.","responses":{"200":{"description":"OK"},"401":{"description":"Unauthorized: missing or invalid X-API-KEY"},"404":{"description":"Not Found"},"422":{"description":"Unprocessable Entity"},"429":{"description":"Too Many Requests"}},"summary":"Health Check"}},"/api/messages/{message_id}":{"delete":{"description":"Deletes the Message resource.","responses":{"200":{"description":"OK"},"401":{"description":"Unauthorized: missing or invalid X-API-KEY"},"404":{"description":"Not Found"},"422":{"description":"Unprocessable Entity"},"429":{"description":"Too Many Requests"}},"summary":"Delete a Message"},"get":{"description":"Retrieves a Message resource by its id, including threadId, sourceUrl, downloadUrl, and attachment downloadUrl fields.","responses":{"200":{"description":"OK"},"401":{"description":"Unauthorized: missing or invalid X-API-KEY"},"404":{"description":"Not Found"},"422":{"description":"Unprocessable Entity"},"429":{"description":"Too Many Requests"}},"summary":"Get a Message"},"patch":{"description":"Updates a Message resource. Supports read, flagged, auto-delete, and expiry fields.","responses":{"200":{"description":"OK"},"401":{"description":"Unauthorized: missing or invalid X-API-KEY"},"404":{"description":"Not Found"},"422":{"description":"Unprocessable Entity"},"429":{"description":"Too Many Requests"}},"summary":"Update a Message"},"put":{"description":"Accepts the same payload as PATCH /api/messages/{message_id}.","responses":{"200":{"description":"OK"},"401":{"description":"Unauthorized: missing or invalid X-API-KEY"},"404":{"description":"Not Found"},"422":{"description":"Unprocessable Entity"},"429":{"description":"Too Many Requests"}},"summary":"Replace Message State"}},"/api/messages/{message_id}/attachments/{attachment_id}":{"get":{"description":"Downloads an attachment by id.","responses":{"200":{"description":"OK"},"401":{"description":"Unauthorized: missing or invalid X-API-KEY"},"404":{"description":"Not Found"},"422":{"description":"Unprocessable Entity"},"429":{"description":"Too Many Requests"}},"summary":"Download an Attachment"}},"/api/messages/{message_id}/raw":{"get":{"description":"Returns the raw RFC 5322 source of the message.","responses":{"200":{"description":"OK"},"401":{"description":"Unauthorized: missing or invalid X-API-KEY"},"404":{"description":"Not Found"},"422":{"description":"Unprocessable Entity"},"429":{"description":"Too Many Requests"}},"summary":"Get Raw Source"}},"/api/tokens":{"get":{"description":"Lists the API keys of the authenticated user.","responses":{"200":{"description":"OK"},"401":{"description":"Unauthorized: missing or invalid X-API-KEY"},"404":{"description":"Not Found"},"422":{"description":"Unprocessable Entity"},"429":{"description":"Too Many Requests"}},"summary":"List API Keys"},"post":{"description":"Creates an API key. The key value is shown once.","responses":{"200":{"description":"OK"},"401":{"description":"Unauthorized: missing or invalid X-API-KEY"},"404":{"description":"Not Found"},"422":{"description":"Unprocessable Entity"},"429":{"description":"Too Many Requests"}},"summary":"Create an API Key"}},"/api/tokens/{token_id}":{"delete":{"description":"Revokes the API key.","responses":{"200":{"description":"OK"},"401":{"description":"Unauthorized: missing or invalid X-API-KEY"},"404":{"description":"Not Found"},"422":{"description":"Unprocessable Entity"},"429":{"description":"Too Many Requests"}},"summary":"Revoke an API Key"}}},"security":[{"ApiKeyAuth":[]}],"servers":[{"description":"Local instance","url":"/api"}]}
