# Retrieve a received email (/docs/api-reference/receiving/get-received-email)

The received email with its headers, text and HTML bodies (each cut at 2 MB, see `truncated`) and attachment metadata. HTML is the sender's: sanitize it before showing it to anyone.

`GET https://api.coss.com/v1/received_emails/{id}`

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).

## Path parameters

- `id` (string, required): The received email's id.

## 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.get("rcvd_01k7c8m4q2f3e9v6t5r1n0p8yz");
```

HTTP:

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

Python:

```python
from coss import Coss

client = Coss()  # api_key= or COSS_API_KEY

client.email.received.get(
    id="rcvd_01k7c8m4q2f3e9v6t5r1n0p8yz",
)
```

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.GetReceivedRequest{
    ID: "rcvd_01k7c8m4q2f3e9v6t5r1n0p8yz",
}
client.Email.Received.Get(
    context.TODO(),
    request,
)
```

Ruby:

```ruby
require "coss"

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

client.email.received.get(id: "rcvd_01k7c8m4q2f3e9v6t5r1n0p8yz")
```

PHP:

```php
<?php

use Coss\Coss;

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

$client->email->received->get(
    'rcvd_01k7c8m4q2f3e9v6t5r1n0p8yz',
);
```

Java:

```java
import com.coss.Coss;

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

client.email().received().get(
    "rcvd_01k7c8m4q2f3e9v6t5r1n0p8yz",
    GetReceivedRequest
        .builder()
        .build()
);
```

.NET:

```csharp
using Coss;

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

await client.Email.Received.GetAsync(
    new Coss.Email.GetReceivedRequest { Id = "rcvd_01k7c8m4q2f3e9v6t5r1n0p8yz" }
);
```

## Response 200

The received email.

- `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.
- `reply_to` (string[], required): The `Reply-To` header's addresses.
- `in_reply_to` (string | null, required): The `In-Reply-To` header. `null`: none.
- `references` (string[], required): Message ids of the `References` header.
- `sent_at` (string | null, required, date-time): The `Date` header, when valid.
- `headers` (object[], required): Every header in message order (duplicates included).
  - `name` (string, required): The header's name.
  - `value` (string, required): The header's value.
- `text` (string | null, required): The plain text body. `null`: none, or it's `blocked`.
- `html` (string | null, required): The HTML body. `null`: none, or it's `blocked`.
- `truncated` (boolean, required): Whether `text`, `html` or `headers` were shortened (2 MB per body, 64 KB of headers). The raw message always has all of it.

Example:

```json
{
  "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",
  "reply_to": [],
  "in_reply_to": "<x7f3k2m9qp4ld8sv@acme.com>",
  "references": [
    "<x7f3k2m9qp4ld8sv@acme.com>"
  ],
  "sent_at": "2026-10-10T11:59:58.000Z",
  "headers": [
    {
      "name": "From",
      "value": "Jane Doe <jane@example.com>"
    },
    {
      "name": "To",
      "value": "support@inbound.acme.com"
    },
    {
      "name": "Subject",
      "value": "Re: Your order"
    }
  ],
  "text": "Hi, the order arrived damaged.",
  "html": "<p>Hi, the order arrived damaged.</p>",
  "truncated": 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`).
- `404`: No received email with this id exists in this environment. (`not_found`)
- `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`).