# List received emails (/docs/api-reference/receiving/list-received-emails)

Emails received by the API key's environment, newest first, without their bodies and headers (retrieve one for those). Pass the last `id` as `after` to get the next page while `has_more` is true. An `email.received` webhook announces each one as it arrives.

`GET https://api.coss.com/v1/received_emails`

Authenticate with your API key as a bearer token (`Authorization: Bearer coss_test_…`). Responses are JSON with snake_case fields; errors are `{ error: { type, code, message, param?, issues?, request_id } }` (https://coss.com/docs/api-reference/errors.md).

## Query parameters

- `limit` (integer, 1-100): 1-100, default 20.
- `after` (string, at most 64 characters): Cursor: the `id` of the last email of the previous page.

## Example request

TypeScript (the `coss` package):

```ts
import { Coss } from "coss";

const coss = new Coss({
  apiKey: process.env.COSS_API_KEY,
  baseUrl: "https://api.coss.com",
});

const { data, error } = await coss.email.received.list();
```

HTTP:

```sh
curl -X GET "https://api.coss.com/v1/received_emails" \
  -H "Authorization: Bearer $COSS_API_KEY"
```

Python:

```python
from coss import Coss

client = Coss()  # api_key= or COSS_API_KEY

client.email.received.list()
```

Go:

```go
import (
	"context"

	cossclient "github.com/cosscom/coss-go/client"
	email "github.com/cosscom/coss-go/email"
)

client := cossclient.NewClient() // option.WithAPIKey(…) or COSS_API_KEY

request := &email.ListReceivedRequest{}
client.Email.Received.List(
    context.TODO(),
    request,
)
```

Ruby:

```ruby
require "coss"

client = Coss::Client.new # api_key: or COSS_API_KEY

client.email.received.list
```

PHP:

```php
<?php

use Coss\Coss;

$client = new Coss(); // apiKey: or COSS_API_KEY

$client->email->received->list(
    new ListReceivedRequest([]),
);
```

Java:

```java
import com.coss.Coss;

Coss client = Coss.builder().build(); // .apiKey(…) or COSS_API_KEY

client.email().received().list(
    ListReceivedRequest
        .builder()
        .build()
);
```

.NET:

```csharp
using Coss;

var client = new CossClient(); // apiKey: or COSS_API_KEY

await client.Email.Received.ListAsync(new Coss.Email.ListReceivedRequest());
```

## Response 200

A page of received emails.

- `object` ("list", required)
- `data` (object[], required)
  - `object` ("received_email", required)
  - `id` (string, required)
  - `status` ("received" | "blocked", required): `received`, or `blocked` when the message carried a virus: then only its envelope and verdicts are kept, never its content.
  - `blocked_reason` ("virus" | null, required): Why it's `blocked`. `null`: it isn't.
  - `mail_from` (string, required): The envelope sender (`MAIL FROM`); empty for bounces.
  - `recipients` (string[], required): The envelope recipients this environment received the message for (Bcc'd addresses included, other organizations' never).
  - `from` (string | null, required): The `From` header.
  - `to` (string[], required): The `To` header's addresses.
  - `cc` (string[], required): The `Cc` header's addresses.
  - `subject` (string | null, required): The `Subject` header. `null`: none.
  - `message_id` (string | null, required): The `Message-ID` header.
  - `attachments` (object[], required): Its attachments, without their bytes.
    - `id` (string, required)
    - `filename` (string | null, required): `null` when the part named none.
    - `content_type` (string, required)
    - `content_id` (string | null, required): Set for parts the HTML references (`cid:` URLs).
    - `disposition` ("attachment" | "inline", required)
    - `size` (integer, required): Size in bytes.
  - `size` (integer, required): Size of the raw message in bytes.
  - `spam` (boolean, required): Whether the spam verdict is `fail`.
  - `verdicts` (object, required): What the receiving server concluded: `pass`, `fail`, `gray` (could not decide) or `processing_failed`; `null` when the check did not run.
    - `spam` ("pass" | "fail" | "gray" | "processing_failed" | null, required): The spam verdict.
    - `virus` ("pass" | "fail" | "gray" | "processing_failed" | null, required): The virus verdict.
    - `spf` ("pass" | "fail" | "gray" | "processing_failed" | null, required): The SPF verdict.
    - `dkim` ("pass" | "fail" | "gray" | "processing_failed" | null, required): The DKIM verdict.
    - `dmarc` ("pass" | "fail" | "gray" | "processing_failed" | null, required): The DMARC verdict.
    - `dmarc_policy` (string | null, required): The sender domain's DMARC policy (`none`, `quarantine` or `reject`) when DMARC failed.
  - `sandbox` (boolean, required): Whether it was received by a sandbox environment.
  - `received_at` (string, required, date-time): When it arrived.
- `has_more` (boolean, required)

Example:

```json
{
  "object": "list",
  "data": [
    {
      "object": "received_email",
      "id": "rcvd_01k7c8m4q2f3e9v6t5r1n0p8yz",
      "status": "received",
      "blocked_reason": null,
      "mail_from": "jane@example.com",
      "recipients": [
        "support@inbound.acme.com"
      ],
      "from": "Jane Doe <jane@example.com>",
      "to": [
        "support@inbound.acme.com"
      ],
      "cc": [],
      "subject": "Re: Your order",
      "message_id": "<CAF3k2m9qp4ld8sv@mail.example.com>",
      "attachments": [
        {
          "id": "rcvdatt_01k7c8m4r0c2b8w9y3d5f6g7h8",
          "filename": "invoice.pdf",
          "content_type": "application/pdf",
          "content_id": null,
          "disposition": "attachment",
          "size": 48213
        }
      ],
      "size": 61432,
      "spam": false,
      "verdicts": {
        "spam": "pass",
        "virus": "pass",
        "spf": "pass",
        "dkim": "pass",
        "dmarc": "pass",
        "dmarc_policy": null
      },
      "sandbox": false,
      "received_at": "2026-10-10T12:00:00.000Z"
    }
  ],
  "has_more": false
}
```

## Errors

- `400`: The `Coss-Version` header names an unknown API version (`invalid_api_version`).
- `401`: The API key is missing, invalid, revoked or expired (`authentication_error`).
- `403`: The API key lacks the permission this endpoint needs (`permission_error`), or its organization is suspended (`organization_suspended`).
- `422`: A query parameter failed validation (`validation_error`).
- `429`: Too many requests with this API key (`rate_limited`), or too many requests with invalid keys from this address (`too_many_failed_authentications`). Retry after `Retry-After` seconds. Successful responses carry `RateLimit-Limit`, `RateLimit-Remaining` and `RateLimit-Reset` (seconds until the limit is fully restored).
- `500`: Unexpected server error (`api_error` / `internal_error`).
- `503`: The API key could not be verified right now; retry (`service_unavailable`).