v1

latestOpenAPI 3.1.02026-07-24700259.3 KB
EMAIL ARCHIVE

Search archived content

Retrieve a list of up to 5,000 archived emails matching the supplied parameters.

post/archive/search

Request body

start_datestring

ISO-8601 formatted datetime which defaults to current date at midnight. The range will be inclusive of start_date and exclusive of end_date. Timezone is UTC.

end_datestring

ISO-8601 formatted datetime which defaults to now. Timezone is UTC.

limitinteger

The maximum number of emails to return (Default: 5,000)

usernamestring

If passed, only return email details sent by this user

recipientstring

If passed, only return emails with this recipient

senderstring

If passed, only return emails with this sender

envelope_fromstring

If passed, only return emails with this envelope_from

subjectstring

If passed, only return emails with this subject

headersstring

If passed, only return emails with this substring in the headers

continue_tokenstring

If passed, will continue the previous search if too many results were found.

Response

List of archived emails

request_idstring required

Example response

{
  "data": {
    "email_count": 1,
    "emails": [
      {
        "byte_count": 1422,
        "email_id": "1u0SwL-B9zBpi9ffUq-JAB2",
        "envelope_from": "test@test.com",
        "headers": "...",
        "recipient": "test@test.com",
        "sender": "test@test.com",
        "sent": "2021-11-08T18:58:47Z",
        "subject": "test",
        "to": "test@test.com",
        "url": "https://api.smtp2go.com/archive-attachment/...",
        "username": "api-12345678"
      }
    ]
  },
  "request_id": "6eb05270-40f9-11ec-9649-f23c9216bfca"
}