v1

latestOpenAPI 3.1.02026-07-24700259.3 KB
EMAILS

View and search sent emails

Retrieve a list of up to 5,000 sent emails matching the supplied parameters.<br><br>The filter_query field can be used to create complex filters to make your searching more efficient. Find full details in the Email and Email Archive Guide.<br><br><strong>Note:<strong> Allow around two minutes after delivery for recently sent emails to be included in a search result.<br /><br />This endpoint is deprecated and will not be accessible in future API versions. Please use the <a href='https://developers.smtp2go.com/reference/search-activity'>Activity Search</a> endpoint instead.<i>This endpoint is rate-limited to 20 requests per minute.</i>

post/email/search

Request body

start_datestring

ISO-8601 formatted datetime. Results will be inclusive of this value. Timezone is UTC. Defaults to current date at midnight.

end_datestring

ISO-8601 formatted datetime. Results will be inclusive of this value. Timezone is UTC. Defaults to current time.

limitinteger

The maximum number of emails to return. Enter an integer between 1 and 5,000. Defaults to 5,000.

status_countsboolean

If true, will return an object with counts of each unique email status

opened_onlyboolean

If true, will return emails that have been opened by at least one recipient.<br><br><strong>Note:</strong> Only returns information for emails sent from suitable accounts with Open Tracking enabled. See more info at <a href="https://support.smtp2go.com/hc/en-gb/articles/360003124714">Open Tracking</a>

clicked_onlyboolean

If true, will return emails that have had a link clicked by at least one recipient.<br><br><strong>Note:</strong> Only returns information for emails sent from suitable accounts with Click Tracking enabled. See more info at <a href="https://support.smtp2go.com/hc/en-gb/articles/900002237106-Click-Tracking">Click Tracking</a>

ignore_caseboolean

If true, all string searches will be case insensitive

filter_querystring

If passed, will return results filtered by these search parameters. The query format is documented below

email_idstring[]

If passed, will only return emails with an ID contained within this array

usernamestring

If passed, will only return emails sent by this user

headersstring[]

If passed, will return the specified email header values

continue_tokenstring

If passed, the resulting query will paginate from the previous query

Response

List of sent emails

request_idstring

Example response

{
  "request_id": "84fe4a7e-1487-4ddf-92cb-4c6f8e6b2070",
  "data": {
    "count": 1,
    "emails": [
      {
        "sender": "test@example.com",
        "email_id": "1u0SwL-B9zBpi9ffUq-JAB2",
        "smtpcode": 250,
        "response": "250 2.0.0 OK 1466989602 87si22895035pfn.73 - gsmtp",
        "process_status": "completed",
        "host": "gmail-smtp-in.l.google.com [74.125.200.27]",
        "recipient": "test2@example.com",
        "delivered_at": "2016-06-27 01:06:42.668336+00:00",
        "opens": [
          {
            "user_agent": "Mozilla/5.0 (iPad; CPU OS 9_3_5 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Mobile/13G36",
            "opened_at": "2018-04-02 19:26:53.010729+00:00",
            "read_secs": "10",
            "recipient": "test2@example.com",
            "ip_address": "x.x.x.x"
          }
        ],
        "total_opens": 1,
        "status": "delivered",
        "email_ts": "2016-06-27 01:06:37.039400+00:00"
      }
    ],
    "continue_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE0Njc4NTY4ODEsImRhdCI6eyJvZmYiOjUsInFpZCI6MX0sImlzcyI6ImFwaS5zbXRwMmdvLmNvbSIsImlhdCI6MTQ2Nzg1NjU4MX0.Pgl5rl7hsgFrVIa9TTFDyi7Y8o_mCHDPE227qNINQd3_rZwgfnPAhDRmsyQMGqQDJHfr5NNF_V9cPTpWNkXikUUDFaEHoXnFkbDxAqtb6n40KA3pVjG1D8QDKTjONGBqDs3zOujUSb_CR9oYkQXnnFRfy2K-ZXoJuMpqIB3A1gbg3KdZCLjzKHi0hkvIUBCnkERksq9pdAB15dnAkkDliEUHOB2SpA05brBEHTRF_H7az9NkrVm1STPX7x3hq5Qg6gZPWCuwpNKpdP-MnHhThmq67Y8LVL7kmR4dKkON1uamf4UxDK3BK8hef7fty1x1K9BSa8ils5BeolV_2BU0aw"
  }
}