{"openapi":"3.0.0","info":{"version":"1.0.0","title":"Temp Mail API","description":"\n# Temporary Email Service API\n\nA simple and fast temporary email service that allows you to receive emails without registration.\n\n## Features\n- Receive emails on temporary addresses\n- Multiple supported domains managed dynamically\n- Real-time email retrieval\n- No registration required\n- Automatic cleanup\n\n## Response Format\n- **Success responses** include `success: true` and a `result` field\n- **Error responses** include `success: false` and an `error` object\n- **Validation errors** include `success: false` and detailed error information\n\n## Supported Domains\nSupported mailbox domains are managed dynamically in the database. Use the Domains endpoint to retrieve the currently active domains.\n\n**Repository**: [github.com/vwh/temp-mail](https://github.com/vwh/temp-mail)  \n**Issues**: [Report bugs or request features](https://github.com/vwh/temp-mail/issues)\n","contact":{"name":"API Support","url":"https://github.com/vwh/temp-mail"},"license":{"name":"MIT","url":"https://github.com/vwh/temp-mail/blob/main/LICENSE"}},"servers":[{"url":"https://api.barid.site","description":"Production server"}],"tags":[{"name":"Emails","description":"Operations for managing emails by email address"},{"name":"Inbox","description":"Operations for individual email messages"},{"name":"Domains","description":"Get information about supported email domains"}],"x-repository":"https://github.com/vwh/temp-mail","x-issues":"https://github.com/vwh/temp-mail/issues","components":{"schemas":{"EmailSummary":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier for the email.","example":"usm2sw0qfv9a5ku9z4xmh8og"},"from_address":{"type":"string","description":"The sender's email address.","example":"sender@example.com"},"to_address":{"type":"string","description":"The recipient's email address.","example":"recipient@barid.site"},"subject":{"type":"string","nullable":true,"description":"The subject of the email.","example":"Welcome to our service"},"received_at":{"type":"number","description":"The timestamp when the email was received (Unix epoch).","example":1753317948},"has_attachments":{"type":"boolean","default":false,"description":"Whether the email has attachments.","example":true},"attachment_count":{"type":"number","default":0,"description":"The number of attachments in the email.","example":2},"is_public":{"type":"boolean","default":false,"description":"Whether the email is publicly visible.","example":false}},"required":["id","from_address","to_address","subject","received_at"]},"EmailListSuccessResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Indicates if the request was successful.","example":true},"result":{"type":"array","items":{"$ref":"#/components/schemas/EmailSummary"}}},"required":["success","result"]},"ValidationErrorResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[false],"description":"Indicates that the request failed due to a validation error.","example":false},"error":{"type":"object","properties":{"name":{"type":"string","description":"The name of the error.","example":"ZodError"},"message":{"type":"string","description":"The validation error message.","example":"Invalid input."}},"required":["name","message"]}},"required":["success","error"]},"DomainErrorResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[false],"description":"Indicates that the request failed due to a domain error.","example":false},"error":{"type":"object","properties":{"name":{"type":"string","enum":["DomainError"],"description":"The name of the error.","example":"DomainError"},"message":{"type":"string","enum":["Domain not supported"],"description":"The error message.","example":"Domain not supported"}},"required":["name","message"]},"note":{"type":"object","properties":{"supported_domains":{"type":"array","items":{"type":"string"},"description":"A list of currently active mailbox domains.","example":["vaqzmobiz.com","vmhub.top"]}},"required":["supported_domains"]}},"required":["success","error","note"]},"EmailsCountSuccessResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Indicates if the request was successful.","example":true},"result":{"type":"object","properties":{"count":{"type":"number","description":"The number of emails for the specified address.","example":5}},"required":["count"]}},"required":["success","result"]},"DeleteEmailSuccessResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Indicates if the request was successful.","example":true},"result":{"type":"object","properties":{"message":{"type":"string","enum":["Email deleted successfully"],"description":"A message indicating that the email was deleted.","example":"Email deleted successfully"}},"required":["message"]}},"required":["success","result"]},"NotFoundErrorResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[false],"description":"Indicates that the request failed because the email was not found.","example":false},"error":{"type":"object","properties":{"name":{"type":"string","enum":["NotFound"],"description":"The name of the error.","example":"NotFound"},"message":{"type":"string","enum":["Email not found"],"description":"The error message.","example":"Email not found"}},"required":["name","message"]}},"required":["success","error"]},"Email":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier for the email.","example":"usm2sw0qfv9a5ku9z4xmh8og"},"from_address":{"type":"string","description":"The sender's email address.","example":"sender@example.com"},"to_address":{"type":"string","description":"The recipient's email address.","example":"recipient@barid.site"},"subject":{"type":"string","nullable":true,"description":"The subject of the email.","example":"Welcome to our service"},"received_at":{"type":"number","description":"The timestamp when the email was received (Unix epoch).","example":1753317948},"html_content":{"type":"string","nullable":true,"description":"The HTML content of the email.","example":"<p>Hello world</p>"},"text_content":{"type":"string","nullable":true,"description":"The plain text content of the email.","example":"Hello world"},"has_attachments":{"type":"boolean","default":false,"description":"Whether the email has attachments.","example":true},"attachment_count":{"type":"number","default":0,"description":"The number of attachments in the email.","example":2},"is_public":{"type":"boolean","default":false,"description":"Whether the email is publicly visible.","example":false}},"required":["id","from_address","to_address","subject","received_at","html_content","text_content"]},"EmailDetailSuccessResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Indicates if the request was successful.","example":true},"result":{"$ref":"#/components/schemas/Email"}},"required":["success","result"]},"DeleteEmailsSuccessResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Indicates if the request was successful.","example":true},"result":{"type":"object","properties":{"message":{"type":"string","enum":["Emails deleted successfully"],"description":"A message indicating that the emails were deleted.","example":"Emails deleted successfully"},"deleted_count":{"type":"number","description":"The number of emails deleted.","example":2}},"required":["message","deleted_count"]}},"required":["success","result"]},"DomainsSuccessResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Indicates if the request was successful.","example":true},"result":{"type":"array","items":{"type":"string"},"description":"A list of currently active mailbox domains managed in the database.","example":["vaqzmobiz.com","vmhub.top"]}},"required":["success","result"]},"AttachmentSummary":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier for the attachment.","example":"att_usm2sw0qfv9a5ku9z4xmh8og"},"filename":{"type":"string","description":"The original filename of the attachment.","example":"document.pdf"},"content_type":{"type":"string","description":"The MIME type of the attachment.","example":"application/pdf"},"size":{"type":"number","description":"The size of the attachment in bytes.","example":1024000},"created_at":{"type":"number","description":"The timestamp when the attachment was created (Unix epoch).","example":1753317948}},"required":["id","filename","content_type","size","created_at"]},"AttachmentListResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"result":{"type":"array","items":{"$ref":"#/components/schemas/AttachmentSummary"}}},"required":["success","result"]},"AttachmentDeleteResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"result":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}},"required":["success","result"]}},"parameters":{}},"paths":{"/emails/{emailAddress}":{"get":{"tags":["Emails"],"summary":"Get emails","description":"Retrieve all emails for a specific email address with pagination.","parameters":[{"schema":{"type":"string","format":"email","example":"user@example.com","description":"The email address to query for."},"required":true,"description":"The email address to query for.","name":"emailAddress","in":"path"},{"schema":{"type":"number","minimum":1,"maximum":100,"default":10,"example":20,"description":"The maximum number of emails to return."},"required":false,"description":"The maximum number of emails to return.","name":"limit","in":"query"},{"schema":{"type":"number","nullable":true,"minimum":0,"default":0,"example":0,"description":"The number of emails to skip before starting to return results."},"required":false,"description":"The number of emails to skip before starting to return results.","name":"offset","in":"query"}],"responses":{"200":{"description":"Successfully retrieved emails for the specified address","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailListSuccessResponse"}}}},"400":{"description":"Validation error - invalid email format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"404":{"description":"Domain not supported - returns list of supported domains","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainErrorResponse"}}}}}},"delete":{"tags":["Emails"],"summary":"Delete all emails","description":"Delete all emails associated with the specified email address","parameters":[{"schema":{"type":"string","format":"email","example":"user@example.com","description":"The email address to query for."},"required":true,"description":"The email address to query for.","name":"emailAddress","in":"path"}],"responses":{"200":{"description":"Successfully deleted all emails for the address","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteEmailsSuccessResponse"}}}},"400":{"description":"Validation error - invalid email format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}}}},"/emails/count/{emailAddress}":{"get":{"tags":["Emails"],"summary":"Get email count","description":"Retrieve the total number of emails for a specific email address.","parameters":[{"schema":{"type":"string","format":"email","example":"user@example.com","description":"The email address to query for."},"required":true,"description":"The email address to query for.","name":"emailAddress","in":"path"}],"responses":{"200":{"description":"Successfully retrieved the count of emails for the specified address","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailsCountSuccessResponse"}}}},"400":{"description":"Validation error - invalid email format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"404":{"description":"Domain not supported - returns list of supported domains","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainErrorResponse"}}}}}}},"/inbox/{emailId}":{"delete":{"tags":["Inbox"],"summary":"Delete email inbox","description":"Delete a specific inbox by its email ID","parameters":[{"schema":{"type":"string","format":"cuid2","example":"usm2sw0qfv9a5ku9z4xmh8og","description":"The unique identifier for the email."},"required":true,"description":"The unique identifier for the email.","name":"emailId","in":"path"}],"responses":{"200":{"description":"Successfully deleted the email","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteEmailSuccessResponse"}}}},"400":{"description":"Validation error - invalid email ID format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"404":{"description":"Email not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundErrorResponse"}}}}}},"get":{"tags":["Inbox"],"summary":"Get email inbox","description":"Retrieve full email content including HTML and text by email ID","parameters":[{"schema":{"type":"string","format":"cuid2","example":"usm2sw0qfv9a5ku9z4xmh8og","description":"The unique identifier for the email."},"required":true,"description":"The unique identifier for the email.","name":"emailId","in":"path"}],"responses":{"200":{"description":"Successfully retrieved email details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailDetailSuccessResponse"}}}},"400":{"description":"Validation error - invalid email ID format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"404":{"description":"Email not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundErrorResponse"}}}}}}},"/domains":{"get":{"tags":["Domains"],"summary":"Get supported domains","description":"Retrieve a list of all supported email domains","responses":{"200":{"description":"List of all supported email domains","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainsSuccessResponse"}}}}}}},"/emails/{emailAddress}/attachments":{"get":{"summary":"Get attachments for all emails of a recipient","description":"Retrieve a list of all attachments for emails sent to the specified email address.","tags":["Attachments"],"parameters":[{"schema":{"type":"string","format":"email","description":"The recipient email address.","example":"user@example.com"},"required":true,"description":"The recipient email address.","name":"emailAddress","in":"path"},{"schema":{"type":"number","minimum":1,"maximum":100,"default":50,"description":"Maximum number of attachments to return.","example":10},"required":false,"description":"Maximum number of attachments to return.","name":"limit","in":"query"},{"schema":{"type":"number","nullable":true,"minimum":0,"default":0,"description":"Number of attachments to skip.","example":0},"required":false,"description":"Number of attachments to skip.","name":"offset","in":"query"}],"responses":{"200":{"description":"List of attachments retrieved successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentListResponse"}}}},"404":{"description":"Domain not supported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainErrorResponse"}}}}}}},"/inbox/{emailId}/attachments":{"get":{"summary":"Get attachments for a specific email","description":"Retrieve all attachments for a specific email by its ID.","tags":["Attachments"],"parameters":[{"schema":{"type":"string","description":"The unique identifier of the email.","example":"usm2sw0qfv9a5ku9z4xmh8og"},"required":true,"description":"The unique identifier of the email.","name":"emailId","in":"path"}],"responses":{"200":{"description":"Attachments retrieved successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentListResponse"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"404":{"description":"Email not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundErrorResponse"}}}}}}},"/attachments/{attachmentId}":{"get":{"summary":"Download an attachment","description":"Download a specific attachment by its ID.","tags":["Attachments"],"parameters":[{"schema":{"type":"string","description":"The unique identifier of the attachment.","example":"att_usm2sw0qfv9a5ku9z4xmh8og"},"required":true,"description":"The unique identifier of the attachment.","name":"attachmentId","in":"path"}],"responses":{"200":{"description":"Attachment downloaded successfully.","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary","description":"The attachment file content."}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"404":{"description":"Attachment not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundErrorResponse"}}}}}},"delete":{"summary":"Delete an attachment","description":"Delete a specific attachment by its ID.","tags":["Attachments"],"parameters":[{"schema":{"type":"string","description":"The unique identifier of the attachment.","example":"att_usm2sw0qfv9a5ku9z4xmh8og"},"required":true,"description":"The unique identifier of the attachment.","name":"attachmentId","in":"path"}],"responses":{"200":{"description":"Attachment deleted successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentDeleteResponse"}}}},"400":{"description":"Invalid request parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"404":{"description":"Attachment not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundErrorResponse"}}}}}}}}}