Receiving Emails
Retrieve and manage received emails and attachments
Retrieve a list of received emails
GET /emails/receiving
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
limit | integer | no | Maximum number of received emails to return. |
after | string | no | Pagination cursor to fetch results after this email ID. Cannot be used with 'before'. |
before | string | no | Pagination cursor to fetch results before this email ID. Cannot be used with 'after'. |
Example
curl -X GET "$SESAMESEND_URL/emails/receiving" \
-H "Authorization: Bearer $OPENSEND_API_KEY"Responses
| Status | Description |
|---|---|
200 | OK |
{
"object": "list",
"has_more": false,
"data": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"to": [
"delivered@resend.dev"
],
"from": "sender@example.com",
"subject": "Hello World",
"message_id": "<message-id@email.example.com>",
"bcc": null,
"cc": null,
"reply_to": null,
"created_at": "2023-10-06T23:47:56.678Z",
"attachments": [
{}
]
}
]
}Retrieve a single received email
GET /emails/receiving/{email_id}
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
email_id | string | yes | The ID of the received email. |
Example
curl -X GET "$SESAMESEND_URL/emails/receiving/<email_id>" \
-H "Authorization: Bearer $OPENSEND_API_KEY"Responses
| Status | Description |
|---|---|
200 | OK |
{
"object": "email",
"id": "550e8400-e29b-41d4-a716-446655440000",
"to": [
"delivered@resend.dev"
],
"from": "sender@example.com",
"subject": "Hello World",
"message_id": "<message-id@email.example.com>",
"bcc": [],
"cc": [],
"reply_to": [],
"received_for": [
"forwarded@example.com"
],
"html": "<p>Email content</p>",
"text": "Email content",
"headers": {
"X-Custom-Header": "value"
},
"created_at": "2023-10-06T23:47:56.678Z",
"attachments": [
{
"id": "string",
"filename": null,
"content_type": "string",
"content_id": "string",
"content_disposition": "inline",
"size": 1
}
]
}Retrieve a list of attachments for a received email
GET /emails/receiving/{email_id}/attachments
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
email_id | string | yes | The ID of the received email. |
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
limit | integer | no | Maximum number of attachments to return. |
after | string | no | Pagination cursor to fetch results after this attachment ID. Cannot be used with 'before'. |
before | string | no | Pagination cursor to fetch results before this attachment ID. Cannot be used with 'after'. |
Example
curl -X GET "$SESAMESEND_URL/emails/receiving/<email_id>/attachments" \
-H "Authorization: Bearer $OPENSEND_API_KEY"Responses
| Status | Description |
|---|---|
200 | OK |
{
"object": "list",
"has_more": false,
"data": [
{
"id": "660e8400-e29b-41d4-a716-446655440000",
"filename": "document.pdf",
"content_type": "application/pdf",
"content_id": "img001",
"content_disposition": "attachment",
"download_url": "https://cloudfront.example.com/path?Signature=...",
"expires_at": "2024-10-27T18:30:00.000Z",
"size": 2048
}
]
}Retrieve a single attachment for a received email
GET /emails/receiving/{email_id}/attachments/{attachment_id}
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
email_id | string | yes | The ID of the received email. |
attachment_id | string | yes | The ID of the attachment. |
Example
curl -X GET "$SESAMESEND_URL/emails/receiving/<email_id>/attachments/<attachment_id>" \
-H "Authorization: Bearer $OPENSEND_API_KEY"Responses
| Status | Description |
|---|---|
200 | OK |
{
"object": "attachment",
"id": "660e8400-e29b-41d4-a716-446655440000",
"filename": "document.pdf",
"content_type": "application/pdf",
"content_id": "img001",
"content_disposition": "attachment",
"download_url": "https://cloudfront.example.com/path?Signature=...",
"expires_at": "2024-10-27T18:30:00.000Z",
"size": 2048
}