Messages
GET /v1/mailboxes/{mailboxId}/mails
Section titled “GET /v1/mailboxes/{mailboxId}/mails”List all emails in a mailbox.
Path Parameters:
| Parameter | Type | Description |
|---|---|---|
mailboxId | string | Mailbox identifier |
Response (200 OK):
{ "items": [ { "id": "f1e2d3c4-b5a6-9876-5432-10fedcba9876", "mailboxId": "ed930b25-dd40-41b3-a712-e502fbcc5565", "sender": "sender@example.com", "subject": "Welcome!", "body": "This is a test email.", "owner": "user_123abc", "hasAttachments": true, "attachments": [ { "id": "12345678-1234-1234-1234-123456789abc", "name": "document.pdf", "sizeBytes": 102400 } ], "receivedAt": "2024-01-18T00:15:00Z", "headers": "...", "htmlBody": "<p>This is a test email.</p>" } ]}Response Fields:
| Field | Type | Description |
|---|---|---|
id | string | Unique email identifier |
mailboxId | string | Parent mailbox identifier |
sender | string | Email sender address |
subject | string | Email subject line |
body | string | Email body content (plain text) |
owner | string | User ID of the mailbox owner |
hasAttachments | boolean | Whether email has attachments |
attachments | array | List of attachment metadata (if any) |
receivedAt | string | ISO 8601 timestamp when email was received |
headers | string | Raw email headers (if available) |
htmlBody | string | HTML body content (if available) |
Status Codes:
200 OK: Success401 Unauthorized: Invalid or missing API key403 Forbidden: You don’t have access to this mailbox404 Not Found: Mailbox not found
Example:
curl https://api.minutemail.co/v1/mailboxes/ed930b25-dd40-41b3-a712-e502fbcc5565/mails \ -H "Authorization: Bearer mmak_FKI5IKBJ4FSZJLUFGJ3IMF4A55W2OZW7YMLWD3JI33IVUGDEJXLQ"GET /v1/mailboxes/{mailboxId}/mails/{mailId}
Section titled “GET /v1/mailboxes/{mailboxId}/mails/{mailId}”Retrieve a specific email.
Path Parameters:
| Parameter | Type | Description |
|---|---|---|
mailboxId | string | Mailbox identifier |
mailId | string | Email identifier |
Response (200 OK):
{ "id": "f1e2d3c4-b5a6-9876-5432-10fedcba9876", "mailboxId": "ed930b25-dd40-41b3-a712-e502fbcc5565", "sender": "sender@example.com", "subject": "Welcome!", "body": "This is a test email.", "owner": "user_123abc", "hasAttachments": true, "attachments": [ { "id": "12345678-1234-1234-1234-123456789abc", "name": "document.pdf", "sizeBytes": 102400 } ], "receivedAt": "2024-01-18T00:15:00Z", "headers": "...", "htmlBody": "<p>This is a test email.</p>"}Status Codes:
200 OK: Success401 Unauthorized: Invalid or missing API key403 Forbidden: You don’t have access to this mailbox404 Not Found: Mailbox or email not found
Example:
curl https://api.minutemail.co/v1/mailboxes/ed930b25-dd40-41b3-a712-e502fbcc5565/mails/f1e2d3c4-b5a6-9876-5432-10fedcba9876 \ -H "Authorization: Bearer mmak_FKI5IKBJ4FSZJLUFGJ3IMF4A55W2OZW7YMLWD3JI33IVUGDEJXLQ"DELETE /v1/mailboxes/{mailboxId}/mails
Section titled “DELETE /v1/mailboxes/{mailboxId}/mails”Delete multiple emails from a mailbox in a single request. All attachments are also deleted.
Path Parameters:
| Parameter | Type | Description |
|---|---|---|
mailboxId | string | Mailbox identifier |
Request Body:
{ "ids": [ "f1e2d3c4-b5a6-9876-5432-10fedcba9876", "a2b3c4d5-e6f7-8765-4321-0fedcba98765", "b3c4d5e6-f7a8-7654-3210-fedcba987654" ]}Parameters:
| Field | Type | Description | Required |
|---|---|---|---|
ids | array[string] | Array of email identifiers to delete | Yes |
Response: No content
Status Codes:
204 No Content: All emails successfully deleted400 Bad Request: Invalid input (empty ids array, malformed JSON)401 Unauthorized: Invalid or missing API key403 Forbidden: You don’t have access to this mailbox404 Not Found: Mailbox not found
Notes:
- Mailbox ownership is validated before processing
- All attachments associated with the emails are also deleted
- Operation is atomic - either all emails are deleted or none
- Silently skips non-existent email IDs
Example:
curl -X DELETE https://api.minutemail.co/v1/mailboxes/ed930b25-dd40-41b3-a712-e502fbcc5565/mails \ -H "Authorization: Bearer mmak_FKI5IKBJ4FSZJLUFGJ3IMF4A55W2OZW7YMLWD3JI33IVUGDEJXLQ" \ -H "Content-Type: application/json" \ -d '{ "ids": [ "f1e2d3c4-b5a6-9876-5432-10fedcba9876", "a2b3c4d5-e6f7-8765-4321-0fedcba98765" ] }'DELETE /v1/mailboxes/{mailboxId}/mails/{mailId}
Section titled “DELETE /v1/mailboxes/{mailboxId}/mails/{mailId}”Delete a specific email.
Path Parameters:
| Parameter | Type | Description |
|---|---|---|
mailboxId | string | Mailbox identifier |
mailId | string | Email identifier |
Response: No content
Status Codes:
204 No Content: Successfully deleted401 Unauthorized: Invalid or missing API key403 Forbidden: You don’t have access to this mailbox404 Not Found: Mailbox or email not found
Example:
curl -X DELETE https://api.minutemail.co/v1/mailboxes/ed930b25-dd40-41b3-a712-e502fbcc5565/mails/f1e2d3c4-b5a6-9876-5432-10fedcba9876 \ -H "Authorization: Bearer mmak_FKI5IKBJ4FSZJLUFGJ3IMF4A55W2OZW7YMLWD3JI33IVUGDEJXLQ"Attachments
Section titled “Attachments”GET /v1/mailboxes/{mailboxId}/mails/{mailId}/attachments
Section titled “GET /v1/mailboxes/{mailboxId}/mails/{mailId}/attachments”List all attachments for an email.
Path Parameters:
| Parameter | Type | Description |
|---|---|---|
mailboxId | string | Mailbox identifier |
mailId | string | Email identifier |
Response (200 OK):
{ "items": [ { "id": "12345678-1234-1234-1234-123456789abc", "mailboxId": "ed930b25-dd40-41b3-a712-e502fbcc5565", "mailId": "f1e2d3c4-b5a6-9876-5432-10fedcba9876", "filename": "document.pdf", "contentType": "application/pdf", "sizeBytes": 102400, "owner": "user_123abc", "downloadUrl": "/v1/mailboxes/ed930b25-dd40-41b3-a712-e502fbcc5565/mails/f1e2d3c4-b5a6-9876-5432-10fedcba9876/attachments/12345678-1234-1234-1234-123456789abc", "createdAt": "2024-01-18T00:15:00Z" } ]}Response Fields:
| Field | Type | Description |
|---|---|---|
id | string | Unique attachment identifier |
mailboxId | string | Parent mailbox identifier |
mailId | string | Parent email identifier |
filename | string | Attachment filename |
contentType | string | MIME type (e.g., application/pdf, image/png) |
sizeBytes | number | File size in bytes |
owner | string | User ID of the mailbox owner |
downloadUrl | string | API path to download the attachment content |
createdAt | string | ISO 8601 timestamp when the attachment was created |
Status Codes:
200 OK: Success401 Unauthorized: Invalid or missing API key403 Forbidden: You don’t have access to this mailbox404 Not Found: Mailbox or email not found
Example:
curl https://api.minutemail.co/v1/mailboxes/ed930b25-dd40-41b3-a712-e502fbcc5565/mails/f1e2d3c4-b5a6-9876-5432-10fedcba9876/attachments \ -H "Authorization: Bearer mmak_FKI5IKBJ4FSZJLUFGJ3IMF4A55W2OZW7YMLWD3JI33IVUGDEJXLQ"GET /v1/mailboxes/{mailboxId}/mails/{mailId}/attachments/{attachmentId}
Section titled “GET /v1/mailboxes/{mailboxId}/mails/{mailId}/attachments/{attachmentId}”Download a specific attachment.
Path Parameters:
| Parameter | Type | Description |
|---|---|---|
mailboxId | string | Mailbox identifier |
mailId | string | Email identifier |
attachmentId | string | Attachment identifier |
Response (200 OK):
{ "id": "12345678-1234-1234-1234-123456789abc", "mailboxId": "ed930b25-dd40-41b3-a712-e502fbcc5565", "mailId": "f1e2d3c4-b5a6-9876-5432-10fedcba9876", "filename": "document.pdf", "contentType": "application/pdf", "sizeBytes": 102400, "owner": "user_123abc", "downloadUrl": "/v1/mailboxes/ed930b25-dd40-41b3-a712-e502fbcc5565/mails/f1e2d3c4-b5a6-9876-5432-10fedcba9876/attachments/12345678-1234-1234-1234-123456789abc", "data": "JVBERi0xLjQKJ...", "createdAt": "2024-01-18T00:15:00Z"}Response Fields:
| Field | Type | Description |
|---|---|---|
id | string | Unique attachment identifier |
mailboxId | string | Parent mailbox identifier |
mailId | string | Parent email identifier |
filename | string | Attachment filename |
contentType | string | MIME type |
sizeBytes | number | File size in bytes |
owner | string | User ID of the mailbox owner |
downloadUrl | string | API path to download the attachment content |
data | string | Base64-encoded file content |
createdAt | string | ISO 8601 timestamp when the attachment was created |
Note: The attachment content is returned as a base64-encoded string in the
datafield. Decode it before saving to disk.
Status Codes:
200 OK: Success401 Unauthorized: Invalid or missing API key403 Forbidden: You don’t have access to this mailbox404 Not Found: Mailbox, email, or attachment not found
Example:
# Download and save attachmentcurl -s https://api.minutemail.co/v1/mailboxes/ed930b25-dd40-41b3-a712-e502fbcc5565/mails/f1e2d3c4-b5a6-9876-5432-10fedcba9876/attachments/12345678-1234-1234-1234-123456789abc \ -H "Authorization: Bearer mmak_FKI5IKBJ4FSZJLUFGJ3IMF4A55W2OZW7YMLWD3JI33IVUGDEJXLQ" \ | jq -r '.data' | base64 -d > document.pdfDELETE /v1/mailboxes/{mailboxId}/mails/{mailId}/attachments
Section titled “DELETE /v1/mailboxes/{mailboxId}/mails/{mailId}/attachments”Delete multiple attachments from an email in a single request.
Path Parameters:
| Parameter | Type | Description |
|---|---|---|
mailboxId | string | Mailbox identifier |
mailId | string | Email identifier |
Request Body:
{ "ids": [ "12345678-1234-1234-1234-123456789abc", "23456789-2345-2345-2345-234567890bcd", "34567890-3456-3456-3456-345678901cde" ]}Parameters:
| Field | Type | Description | Required |
|---|---|---|---|
ids | array[string] | Array of attachment identifiers to delete | Yes |
Response: No content
Status Codes:
204 No Content: All attachments successfully deleted400 Bad Request: Invalid input (empty ids array, malformed JSON)401 Unauthorized: Invalid or missing API key403 Forbidden: You don’t have access to this mailbox404 Not Found: Mailbox or email not found
Notes:
- Mailbox ownership is validated before processing
- Attachment summaries are automatically refreshed after deletion
- Silently skips non-existent attachment IDs
Example:
curl -X DELETE https://api.minutemail.co/v1/mailboxes/ed930b25-dd40-41b3-a712-e502fbcc5565/mails/f1e2d3c4-b5a6-9876-5432-10fedcba9876/attachments \ -H "Authorization: Bearer mmak_FKI5IKBJ4FSZJLUFGJ3IMF4A55W2OZW7YMLWD3JI33IVUGDEJXLQ" \ -H "Content-Type: application/json" \ -d '{ "ids": [ "12345678-1234-1234-1234-123456789abc", "23456789-2345-2345-2345-234567890bcd" ] }'DELETE /v1/mailboxes/{mailboxId}/mails/{mailId}/attachments/{attachmentId}
Section titled “DELETE /v1/mailboxes/{mailboxId}/mails/{mailId}/attachments/{attachmentId}”Delete a specific attachment.
Path Parameters:
| Parameter | Type | Description |
|---|---|---|
mailboxId | string | Mailbox identifier |
mailId | string | Email identifier |
attachmentId | string | Attachment identifier |
Response: No content
Status Codes:
204 No Content: Successfully deleted401 Unauthorized: Invalid or missing API key403 Forbidden: You don’t have access to this mailbox404 Not Found: Mailbox, email, or attachment not found
Example:
curl -X DELETE https://api.minutemail.co/v1/mailboxes/ed930b25-dd40-41b3-a712-e502fbcc5565/mails/f1e2d3c4-b5a6-9876-5432-10fedcba9876/attachments/12345678-1234-1234-1234-123456789abc \ -H "Authorization: Bearer mmak_FKI5IKBJ4FSZJLUFGJ3IMF4A55W2OZW7YMLWD3JI33IVUGDEJXLQ"