Skip to Content
sesameSend

Receiving Emails

Retrieve and manage received emails and attachments

Retrieve a list of received emails

GET /emails/receiving

Query parameters

NameTypeRequiredDescription
limitintegernoMaximum number of received emails to return.
afterstringnoPagination cursor to fetch results after this email ID. Cannot be used with 'before'.
beforestringnoPagination 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

StatusDescription
200OK
{
  "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

NameTypeRequiredDescription
email_idstringyesThe ID of the received email.

Example

curl -X GET "$SESAMESEND_URL/emails/receiving/<email_id>" \
  -H "Authorization: Bearer $OPENSEND_API_KEY"

Responses

StatusDescription
200OK
{
  "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

NameTypeRequiredDescription
email_idstringyesThe ID of the received email.

Query parameters

NameTypeRequiredDescription
limitintegernoMaximum number of attachments to return.
afterstringnoPagination cursor to fetch results after this attachment ID. Cannot be used with 'before'.
beforestringnoPagination 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

StatusDescription
200OK
{
  "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

NameTypeRequiredDescription
email_idstringyesThe ID of the received email.
attachment_idstringyesThe ID of the attachment.

Example

curl -X GET "$SESAMESEND_URL/emails/receiving/<email_id>/attachments/<attachment_id>" \
  -H "Authorization: Bearer $OPENSEND_API_KEY"

Responses

StatusDescription
200OK
{
  "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
}