---
title: "Search archived content"
method: POST
path: "/archive/search"
tags: ["EMAIL ARCHIVE"]
---

# Search archived content

`POST /archive/search`

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

## Request body

- object
  - `start_date` string — 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_date` string — ISO-8601 formatted datetime which defaults to now. Timezone is UTC.
  - `limit` integer — The maximum number of emails to return (Default: 5,000)
  - `username` string — If passed, only return email details sent by this user
  - `recipient` string — If passed, only return emails with this recipient
  - `sender` string — If passed, only return emails with this sender
  - `envelope_from` string — If passed, only return emails with this envelope_from
  - `subject` string — If passed, only return emails with this subject
  - `headers` string — If passed, only return emails with this substring in the headers
  - `continue_token` string — If passed, will continue the previous search if too many results were found.

## Response `200`

List of archived emails

- object
  - `data` object, required
    - `email_count` integer, required
    - `emails` object[], required
      - `attachment_count` integer, required
      - `attachments` unknown[], required
        - unknown
      - `byte_count` integer, required
      - `email_id` string, required
      - `envelope_from` string, required
      - `headers` string, required
      - `recipient` string, required
      - `sender` string, required
      - `sent` string, required
      - `subject` string, required
      - `to` string, required
      - `url` string, required — A url that can be used to download the original email
      - `username` string, required
  - `request_id` string, required

## Other responses

- `400` — 400

---

[API](https://skmtc.net/smtp2go/apis/smtp2go-api-v3-0-4.md) · [All operations](https://skmtc.net/smtp2go/apis/smtp2go-api-v3-0-4/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/smtp2go/smtp2go-api-v3-0-4/versions/1ba6b25eebb9/schema)
