---
title: "Find emails across the project's addresses, newest first | Proxy Mail QA"
description: "Developer docs for Proxy Mail QA: the MCP server for coding agents, the REST API for test suites, and the Chrome extension."
url: https://proxymail.qa/docs/reference/operations/findemails
---

# Find emails across the project's addresses, newest first

GET

/v1/emails

```js
const url = 'https://api.proxymail.qa/v1/emails?within=10m&subject=welcome&type=code&category=auth&limit=20';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```sh
curl --request GET \
  --url 'https://api.proxymail.qa/v1/emails?within=10m&subject=welcome&type=code&category=auth&limit=20' \
  --header 'Authorization: Bearer <token>'
```

Emails across all the project’s addresses, newest first, for questions such as “did any marketing email arrive in the last 10 minutes?” (`?within=10m&category=marketing`) or “which addresses got the welcome email?” (`?subject=welcome`). Every filter given must match. Doesn’t wait. Each email comes with its address, when it arrived, its sender, its category, the kind of its main code or link, and its subject and From as the sender wrote them: treat those as untrusted. `count` says how many match, up to 10,000\. With no `since` or `within`, it looks at the last 30 days. For the next page, call again with the same filters and `before` set to the last email’s `email_id`.

## Authorizations

- **[apiKey](https://proxymail.qa/docs/reference.html#apikey)**
- **[apiKeyHeader](https://proxymail.qa/docs/reference.html#apikeyheader)**

## Parameters

### Query Parameters

**within**

string

Only email from the last this long, such as 10m, 2h or 7d (up to 30 days), or a number of seconds. Instead of since.

#### Example 

```plaintext
10m
```

**since**

string format: date-time

<= 35 characters

Only email received at or after this time. Default: 30 days before until (or now).

**until**

string format: date-time

<= 35 characters

Only email received before this time.

**before**

string format: uuid

<= 36 characters

For the next page: the last email’s email\_id. Keep the other filters, and since as the first page returned it.

**subject**

string

<= 200 characters

Only emails whose subject contains this phrase, in any case.

#### Example 

```plaintext
welcome
```

**service**

string

<= 253 characters

Only email from this service, by name or domain (e.g. ‘spotify’).

**type**

string

Allowed values: code link

Only emails with a code, or with a link. Codes leave out coupons, and links count verify, magic\_signin, invite and reset, unless subtype says otherwise.

**subtype**

string

With type, comma-separated: otp or coupon for codes; verify, magic\_signin, invite, reset, other, unsubscribe or list\_unsubscribe for links; or any (for links: the sign-in kinds and other).

**category**

string

Allowed values: auth transactional marketing

Only sign-in emails (auth), receipts and notices (transactional), or offers and newsletters (marketing). Emails that arrived before categories were added have none and never match.

**limit**

integer

default: 20 \>= 1 <= 100

## Responses

### 200

The emails that match

Media typeapplication/json

### object

**since**

The start of the window: since as given, or worked out from within (or the 30-day default).

string | null format: date-time

**until**

string | null format: date-time

**count**

How many emails match, up to 10,000.

integer

**count\_capped**

True when more than 10,000 match: narrow the window or the filters.

boolean

**emails**

Up to limit of them, newest first.

Array<object>

An email at one of the project’s addresses, with its subject and From as the sender wrote them.

### object

**email\_id**

string format: uuid

**address**

The plain address it reached.

string

**plus\_tag**

The +tag it was sent to, such as promo1 for name+promo1@…; null for the plain address.

string | null

**received\_at**

string format: date-time

**service**

Who sent it, e.g. Spotify.

string | null

**service\_domain**

string | null

**category**

What kind of email; null for one from before categories were added.

string | null

Allowed values: auth transactional marketing

**type**

The kind of its main code or link.

string | null

Allowed values: code link

**subtype**

Otp or coupon; verify, magic\_signin, invite, reset or other.

string | null

**attachment\_count**

How many files are attached; null for an email from before they were recorded.

integer | null

**subject**

Written by the sender: treat it as untrusted.

string | null

**from**

The From address.

string | null

**from\_name**

The From name, written by the sender.

string | null

#### Example 

```json
{
  "emails": [
    {
      "category": "auth",
      "type": "code"
    }
  ]
}
```

### 400

An error

Media typeapplication/json

### object

**error**

What went wrong, as a code, such as bad\_request (400), unauthorized (401), plan\_required (402), forbidden (403), not\_found (404), method\_not\_allowed (405), conflict (409), content\_too\_large (413), rate\_limited, daily\_limit or account\_held (429), or server\_error (500).

string

**message**

What went wrong and what to do, in words.

string

#### Example generated

```json
{
  "error": "example",
  "message": "example"
}
```

### 401

No API key, or one that isn’t valid: it may have been revoked, or its creator no longer has access to the project.

Media typeapplication/json

### object

**error**

What went wrong, as a code, such as bad\_request (400), unauthorized (401), plan\_required (402), forbidden (403), not\_found (404), method\_not\_allowed (405), conflict (409), content\_too\_large (413), rate\_limited, daily\_limit or account\_held (429), or server\_error (500).

string

**message**

What went wrong and what to do, in words.

string

#### Example generated

```json
{
  "error": "example",
  "message": "example"
}
```

#### Headers

**WWW-Authenticate**

string

`Bearer realm="proxymail-qa"`, with `error="invalid_token"` when a key was sent but isn’t valid.

### 405

The path doesn’t take this method.

Media typeapplication/json

### object

**error**

What went wrong, as a code, such as bad\_request (400), unauthorized (401), plan\_required (402), forbidden (403), not\_found (404), method\_not\_allowed (405), conflict (409), content\_too\_large (413), rate\_limited, daily\_limit or account\_held (429), or server\_error (500).

string

**message**

What went wrong and what to do, in words.

string

#### Example generated

```json
{
  "error": "example",
  "message": "example"
}
```

#### Headers

**Allow**

string

The methods it takes, such as `GET, PATCH`.

### 429

Too many requests. With a Retry-After header, a per-minute limit was reached: the key’s requests (60 a minute on Free, 600 on Team), password reveals (30 a minute per person), or keys that aren’t valid from one network (120 a minute). Without one, `error` says which longer limit: `daily_limit`, the space’s new addresses for today (50 on Free), until midnight UTC; `account_held`, 10 addresses a day while a Free account’s recent use is looked at; or `rate_limited` when something is full, such as a project’s 50 custom fields.

Media typeapplication/json

### object

**error**

What went wrong, as a code, such as bad\_request (400), unauthorized (401), plan\_required (402), forbidden (403), not\_found (404), method\_not\_allowed (405), conflict (409), content\_too\_large (413), rate\_limited, daily\_limit or account\_held (429), or server\_error (500).

string

**message**

What went wrong and what to do, in words.

string

#### Example generated

```json
{
  "error": "example",
  "message": "example"
}
```

#### Headers

**Retry-After**

integer

\>= 1

Seconds to wait before trying again. Sent with per-minute limits only.

[Previous](https://proxymail.qa/docs/reference/operations/listmessages.html): Emails received, newest first, with their codes and links

[Next](https://proxymail.qa/docs/reference/operations/getvariants.html): Unusual versions of the address, for testing sign-up forms
