{"openapi":"3.1.0","info":{"title":"Receiver.email API","version":"1","summary":"Programmable email inboxes for tests and AI agents.","description":"Mint an address, trigger an email from your app, then wait for it, read its\nOTP code or links, list and download mail.\n\nAuthenticate with a project API key: `Authorization: Bearer recv_live_...`.\nA key belongs to one project; `GET /whoami` returns it, so `projectId` can\nalways be discovered from the key alone.\n\nWaits never return an error on timeout: `wait` and `otp` answer\n`{ \"status\": \"timeout\", \"since\", \"waitedSeconds\", \"retry\": true }`; call\nagain with the same `since`. The official SDKs loop for you.\n\nRate limits: requests per minute per organization (by plan). Every\nauthenticated response carries `X-RateLimit-Limit`, `X-RateLimit-Remaining`\nand `X-RateLimit-Reset`; a `429` adds `Retry-After`.\n","contact":{"name":"Receiver.email","url":"https://www.receiver.email/docs","email":"contact@receiver.email"}},"externalDocs":{"description":"Documentation","url":"https://www.receiver.email/docs/api-reference"},"servers":[{"url":"https://api.receiver.email/api/v1"}],"security":[{"apiKey":[]}],"tags":[{"name":"Account"},{"name":"Inboxes"},{"name":"Emails"}],"paths":{"/whoami":{"get":{"operationId":"whoami","tags":["Account"],"summary":"The API key's project","description":"The project (and its `emailSuffix`) the key belongs to. A dashboard session gets `{ authType: \"jwt\", user }` instead.","responses":{"200":{"description":"The credential's project","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhoAmI"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/projects":{"get":{"operationId":"listProjects","tags":["Account"],"summary":"List projects","description":"With an API key, the key's own project only.","responses":{"200":{"description":"Projects","content":{"application/json":{"schema":{"type":"object","required":["projects"],"properties":{"projects":{"type":"array","items":{"$ref":"#/components/schemas/Project"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/projects/{projectId}":{"get":{"operationId":"getProject","tags":["Account"],"summary":"Get a project","parameters":[{"$ref":"#/components/parameters/projectId"}],"responses":{"200":{"description":"The project with its email count","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Project"},{"type":"object","required":["stats"],"properties":{"stats":{"type":"object","required":["emailsTotal"],"properties":{"emailsTotal":{"type":"integer","minimum":0}}}}}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/projects/{projectId}/inboxes":{"post":{"operationId":"createInbox","tags":["Inboxes"],"summary":"Mint an address","description":"Returns a new, unique address in the project. Nothing is stored until\nmail arrives; any address under the project's suffix receives mail.\nUse `createdAt` as `since` when waiting on it.\n","parameters":[{"$ref":"#/components/parameters/projectId"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"prefix":{"type":"string","pattern":"^[a-zA-Z0-9._+-]{1,40}$","description":"Lowercased; the API appends `-` and 6 random characters. Omitted → `inbox-<8 random>`."}}}}}},"responses":{"201":{"description":"The new address","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Inbox"}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/projects/{projectId}/test-email":{"post":{"operationId":"sendTestEmail","tags":["Inboxes"],"summary":"Send a test email to one of the project's addresses","description":"Sends \"Your Receiver.email test code: 123456\". At most 10 per project per hour.","parameters":[{"$ref":"#/components/parameters/projectId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["to"],"properties":{"to":{"type":"string","format":"email","description":"An address ending with the project's `emailSuffix`."}}}}}},"responses":{"202":{"description":"Sent","content":{"application/json":{"schema":{"type":"object","required":["to","sentAt"],"properties":{"to":{"type":"string","format":"email"},"sentAt":{"type":"string","format":"date-time"}}}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"description":"The email provider refused the message (`EMAIL_SEND_FAILED`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/projects/{projectId}/emails":{"get":{"operationId":"listEmails","tags":["Emails"],"summary":"List emails, newest first","description":"With `subject` or `hasAttachments` a page can hold fewer than `limit`\nemails, even none, while `hasMore` is true: keep following `nextCursor`.\n","parameters":[{"$ref":"#/components/parameters/projectId"},{"$ref":"#/components/parameters/recipient"},{"$ref":"#/components/parameters/sender"},{"$ref":"#/components/parameters/subject"},{"$ref":"#/components/parameters/since"},{"$ref":"#/components/parameters/receivedBefore"},{"name":"hasAttachments","in":"query","schema":{"type":"string","enum":["true","false"]}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"cursor","in":"query","description":"`nextCursor` from the previous page.","schema":{"type":"string"}}],"responses":{"200":{"description":"A page of emails","content":{"application/json":{"schema":{"type":"object","required":["emails","hasMore"],"properties":{"emails":{"type":"array","items":{"$ref":"#/components/schemas/EmailListItem"}},"hasMore":{"type":"boolean"},"nextCursor":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/projects/{projectId}/emails/wait":{"get":{"operationId":"waitForEmail","tags":["Emails"],"summary":"Long-poll for the newest matching email","description":"Holds the request until an email matching the filters arrives after\n`since`, or `timeout` seconds pass. Both outcomes are `200`.\n","parameters":[{"$ref":"#/components/parameters/projectId"},{"$ref":"#/components/parameters/recipient"},{"$ref":"#/components/parameters/sender"},{"$ref":"#/components/parameters/subject"},{"$ref":"#/components/parameters/sinceDefaultLookback"},{"name":"timeout","in":"query","description":"Seconds to wait.","schema":{"type":"integer","minimum":0,"maximum":60,"default":30}}],"responses":{"200":{"description":"An email arrived, or the wait timed out","content":{"application/json":{"schema":{"oneOf":[{"type":"object","required":["status","email"],"properties":{"status":{"const":"received"},"email":{"$ref":"#/components/schemas/WaitEmail"}}},{"$ref":"#/components/schemas/WaitTimeout"}]}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/projects/{projectId}/emails/otp":{"get":{"operationId":"getOtp","tags":["Emails"],"summary":"Extract a one-time code, optionally waiting for it","description":"Scans up to 10 matching emails after `since`, newest first. Without\n`codeLength`, finds 4, 6 and 8-digit codes and 6 to 8-character\nalphanumeric ones; 5 and 7-digit codes only when asked for.\n","parameters":[{"$ref":"#/components/parameters/projectId"},{"$ref":"#/components/parameters/recipient"},{"$ref":"#/components/parameters/sender"},{"$ref":"#/components/parameters/subject"},{"$ref":"#/components/parameters/sinceDefaultLookback"},{"$ref":"#/components/parameters/receivedBefore"},{"name":"codeLength","in":"query","schema":{"type":"integer","minimum":4,"maximum":8}},{"name":"timeout","in":"query","description":"Seconds to wait for a code (0 checks once).","schema":{"type":"integer","minimum":0,"maximum":60,"default":0}}],"responses":{"200":{"description":"A code was found, or the wait timed out","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/OtpFound"},{"$ref":"#/components/schemas/WaitTimeout"}]}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/projects/{projectId}/emails/stream":{"get":{"operationId":"streamEmails","tags":["Emails"],"summary":"Server-Sent Events of new emails","description":"Each matching email with `receivedAt > since`, oldest first:\n`event: email`, `id: <emailId>`, `data:` a `StreamEvent` (JSON).\nA `: ping` comment every 15 s. After about 55 s the server sends\n`event: end` with `data: {\"since\": \"<ISO>\"}` and closes; reconnect with\nthat `since`. One connection sends at most 500 emails.\n","parameters":[{"$ref":"#/components/parameters/projectId"},{"$ref":"#/components/parameters/recipient"},{"$ref":"#/components/parameters/sender"},{"$ref":"#/components/parameters/subject"},{"name":"since","in":"query","description":"Only emails received strictly after this time. Default now.","schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"An event stream","content":{"text/event-stream":{"schema":{"type":"string","description":"SSE frames. `email` events carry a `StreamEvent`, `end` events a `StreamEnd`."},"x-event-schemas":{"email":{"$ref":"#/components/schemas/StreamEvent"},"end":{"$ref":"#/components/schemas/StreamEnd"}}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/projects/{projectId}/emails/{emailId}":{"get":{"operationId":"getEmail","tags":["Emails"],"summary":"Get an email with its bodies, headers and attachments","parameters":[{"$ref":"#/components/parameters/projectId"},{"$ref":"#/components/parameters/emailId"}],"responses":{"200":{"description":"The email","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailDetail"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"delete":{"operationId":"deleteEmail","tags":["Emails"],"summary":"Delete an email","parameters":[{"$ref":"#/components/parameters/projectId"},{"$ref":"#/components/parameters/emailId"}],"responses":{"204":{"description":"Deleted"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/projects/{projectId}/emails/{emailId}/{type}":{"get":{"operationId":"getEmailContent","tags":["Emails"],"summary":"An email's full text or HTML body, or its raw RFC 822 source","description":"Full bodies, also when `EmailDetail.textBody` / `htmlBody` hold only a\npreview. HTML is served with a Content-Security-Policy that blocks\nscripts.\n","parameters":[{"$ref":"#/components/parameters/projectId"},{"$ref":"#/components/parameters/emailId"},{"name":"type","in":"path","required":true,"schema":{"type":"string","enum":["text","html","raw"]}}],"responses":{"200":{"description":"The content","content":{"text/plain":{"schema":{"type":"string"}},"text/html":{"schema":{"type":"string"}},"message/rfc822":{"schema":{"type":"string"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/projects/{projectId}/emails/{emailId}/attachments/{index}":{"get":{"operationId":"getAttachment","tags":["Emails"],"summary":"Download an attachment","description":"`index` is the attachment's position in `EmailDetail.attachments`. Served with its own content type.","parameters":[{"$ref":"#/components/parameters/projectId"},{"$ref":"#/components/parameters/emailId"},{"name":"index","in":"path","required":true,"schema":{"type":"integer","minimum":0}}],"responses":{"200":{"description":"The attachment's bytes","content":{"application/octet-stream":{"schema":{"type":"string","contentMediaType":"application/octet-stream"}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"410":{"description":"The attachment was over the plan's size limit and wasn't stored (`ATTACHMENT_NOT_STORED`; its `omitted` is `too_large`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"}}}}},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"A project API key, `recv_live_...`, created in the dashboard."}},"parameters":{"projectId":{"name":"projectId","in":"path","required":true,"description":"The project's ID (`GET /whoami` returns the key's).","schema":{"type":"string"}},"emailId":{"name":"emailId","in":"path","required":true,"schema":{"type":"string"}},"recipient":{"name":"recipient","in":"query","description":"Exact recipient address (case-insensitive).","schema":{"type":"string"}},"sender":{"name":"sender","in":"query","description":"Exact sender address.","schema":{"type":"string"}},"subject":{"name":"subject","in":"query","description":"Substring of the subject (case-insensitive).","schema":{"type":"string"}},"since":{"name":"since","in":"query","description":"Only emails received strictly after this time (ISO 8601).","schema":{"type":"string","format":"date-time"}},"sinceDefaultLookback":{"name":"since","in":"query","description":"Only emails received strictly after this time (ISO 8601). Default: 60\nseconds before the request. Pass the inbox's `createdAt`, or the\nprevious email's `receivedAt` for \"the next email\".\n","schema":{"type":"string","format":"date-time"}},"receivedBefore":{"name":"receivedBefore","in":"query","description":"Only emails received at or before this time.","schema":{"type":"string","format":"date-time"}}},"responses":{"InvalidRequest":{"description":"Invalid parameters or body (`INVALID_REQUEST`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unauthorized":{"description":"Missing, unknown, revoked or expired API key (`UNAUTHORIZED`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The key belongs to another project, or the action needs a dashboard session (`FORBIDDEN`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"The project or email doesn't exist (`NOT_FOUND`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests (`RATE_LIMIT_EXCEEDED`); see `Retry-After`","headers":{"Retry-After":{"description":"Seconds until the window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"retryAfter":{"type":"string","format":"date-time"}}}]}}}}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","examples":["INVALID_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","LIMIT_REACHED","RATE_LIMIT_EXCEEDED"]},"message":{"type":"string"},"details":{"type":"object","description":"Extra facts for some codes, e.g. `{ limit, max }` with `LIMIT_REACHED`."}}}}},"WhoAmI":{"oneOf":[{"type":"object","title":"API key","required":["authType","project","organizationId","apiKey"],"properties":{"authType":{"const":"apikey"},"project":{"type":"object","required":["id","name","identifier","emailSuffix"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"identifier":{"type":"string","description":"The 8-character address identifier."},"emailSuffix":{"type":"string","description":"Append to a prefix to get an address, e.g. `-a3kx9p2m@receiver.email`.","examples":["-a3kx9p2m@receiver.email"]}}},"organizationId":{"type":"string"},"apiKey":{"type":"object","required":["id","name"],"properties":{"id":{"type":"string"},"name":{"type":"string"}}},"credential":{"const":"oauth","description":"Present when authenticated with an OAuth access token (the remote MCP server); `apiKey` then names the connection."}}},{"type":"object","title":"Dashboard session","required":["authType","user"],"properties":{"authType":{"const":"jwt"},"user":{"type":"object","required":["id","email"],"properties":{"id":{"type":"string"},"email":{"type":"string","format":"email"}}}}}]},"Project":{"type":"object","required":["id","organizationId","name","identifier","emailSuffix","createdAt"],"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"identifier":{"type":"string"},"emailSuffix":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}}},"Inbox":{"type":"object","required":["address","prefix","projectId","createdAt"],"properties":{"address":{"type":"string","format":"email","examples":["signup-k2m9qa-a3kx9p2m@receiver.email"]},"prefix":{"type":"string","examples":["signup-k2m9qa"]},"projectId":{"type":"string"},"createdAt":{"type":"string","format":"date-time","description":"Pass as `since` when waiting on this address."}}},"Otp":{"type":"object","required":["code","codeLength","source"],"properties":{"code":{"type":"string"},"codeLength":{"type":"integer"},"source":{"type":"string","enum":["subject","body"]}}},"EmailSummary":{"type":"object","required":["id","projectId","recipient","sender","subject","receivedAt"],"properties":{"id":{"type":"string"},"projectId":{"type":"string"},"recipient":{"type":"string","description":"The address the email was sent to."},"sender":{"type":"string"},"subject":{"type":"string"},"receivedAt":{"type":"string","format":"date-time"}}},"EmailListItem":{"description":"The summary plus preview, attachment counts, size, links and the code the OTP endpoint would extract (with no `codeLength`).","allOf":[{"$ref":"#/components/schemas/EmailSummary"},{"type":"object","required":["textBodyPreview","hasAttachments","attachmentCount","links","otp"],"properties":{"textBodyPreview":{"type":"string"},"hasAttachments":{"type":"boolean"},"attachmentCount":{"type":"integer","minimum":0},"size":{"type":"integer","minimum":0,"description":"Bytes of the raw message."},"links":{"type":"array","description":"Every distinct http(s) URL in the text and HTML bodies, decoded and ready to open.","items":{"type":"string","format":"uri"}},"otp":{"oneOf":[{"$ref":"#/components/schemas/Otp"},{"type":"null"}]}}}]},"WaitEmail":{"description":"A list item plus the text body.","allOf":[{"$ref":"#/components/schemas/EmailListItem"},{"type":"object","properties":{"textBody":{"type":"string"}}}]},"EmailDetail":{"allOf":[{"$ref":"#/components/schemas/EmailSummary"},{"type":"object","required":["hasAttachments","links","otp","attachments","omittedAttachmentCount"],"properties":{"textBody":{"type":"string","description":"The text body, or a preview when it was too large to inline (then `textBodyUri` is set)."},"htmlBody":{"type":"string","description":"The HTML body, or a preview (then `htmlBodyUri` is set)."},"textBodyPreview":{"type":"string"},"htmlBodyPreview":{"type":"string"},"textBodyUri":{"type":"string","format":"uri","description":"The full text body (`GET .../text`), when it was too large to inline."},"htmlBodyUri":{"type":"string","format":"uri","description":"The full HTML body (`GET .../html`), when it was too large to inline."},"hasAttachments":{"type":"boolean"},"attachmentCount":{"type":"integer","minimum":0},"omittedAttachmentCount":{"type":"integer","minimum":0,"description":"Attachments over the plan's size limit, not stored."},"links":{"type":"array","items":{"type":"string","format":"uri"}},"otp":{"oneOf":[{"$ref":"#/components/schemas/Otp"},{"type":"null"}]},"attachments":{"type":"array","items":{"$ref":"#/components/schemas/Attachment"}},"processedAt":{"type":"string","format":"date-time"},"size":{"type":"integer","minimum":0},"headers":{"type":"object","additionalProperties":{"type":"string"}}}}]},"Attachment":{"type":"object","required":["filename","contentType","size"],"properties":{"filename":{"type":"string"},"contentType":{"type":"string"},"size":{"type":"integer","minimum":0},"url":{"type":"string","format":"uri","description":"Where to download it (send the same `Authorization` header). Absent when not stored."},"omitted":{"const":"too_large","description":"Set when the attachment exceeded the plan's size limit and wasn't stored."}}},"WaitTimeout":{"type":"object","required":["status","since","waitedSeconds","retry"],"properties":{"status":{"const":"timeout"},"since":{"type":"string","format":"date-time","description":"The `since` used; send it again on the next call."},"waitedSeconds":{"type":"integer","minimum":0},"retry":{"const":true}}},"OtpCandidate":{"type":"object","required":["code","codeLength","source","email"],"properties":{"code":{"type":"string"},"codeLength":{"type":"integer"},"source":{"type":"string","enum":["subject","body"]},"email":{"$ref":"#/components/schemas/EmailSummary"}}},"OtpFound":{"allOf":[{"$ref":"#/components/schemas/OtpCandidate"},{"type":"object","required":["status","candidates"],"properties":{"status":{"const":"found"},"candidates":{"type":"array","minItems":1,"description":"Every code found in the matching emails, newest first; the first is the result itself.","items":{"$ref":"#/components/schemas/OtpCandidate"}}}}]},"StreamEvent":{"type":"object","required":["email","otp"],"properties":{"email":{"$ref":"#/components/schemas/EmailListItem"},"otp":{"oneOf":[{"$ref":"#/components/schemas/Otp"},{"type":"null"}]}}},"StreamEnd":{"type":"object","required":["since"],"properties":{"since":{"type":"string","format":"date-time","description":"Reconnect with this `since`."}}}}}}