# Retrieve received email

`opensend.inbound.get(id)`

One received email with its text, its HTML and the names of its attachments.

Needs the scope: `emails:read`

## Input

`id` goes first, on its own, and the rest in one object. One object that holds `id` works too.

- `id` (string, required): The id of the item. Up to 64 characters.

## Returns

The call resolves to the answer, already parsed. A call the API refuses throws `OpenSendError` with the code and the message of the answer. [SDK](https://opensend.sh/docs/sdk) lists the errors of the client itself.

- `object` ("inbound_email"): Always `inbound_email`.
- `id` (string): The id of the received email.
- `from` (string): The address it came from.
- `fromName` (string | null): The name of the sender, or `null` when the message gave none.
- `to` (string): The address it was sent to, on one of your domains.
- `subject` (string): The subject line.
- `domain` (string): The domain of yours that received it.
- `spam` (boolean): Whether it was judged to be spam.
- `size` (integer): The size of the whole message in bytes.
- `attachments` (integer): How many files were attached.
- `createdAt` (string): When it arrived.
- `text` (string | null): The message as plain text, or `null`.
- `html` (string | null): The message as HTML, or `null`.
- `truncated` (boolean): Whether the message was too long to keep whole.
- `messageId` (string): The `Message-ID` header of the message.
- `files` (object[]): The attached files. Their content is not kept.
- `files[].filename` (string): The name of the file.
- `files[].mimeType` (string): The media type of the file.
- `files[].size` (integer): The size of the file in bytes.

## Example

TypeScript:

```ts
await opensend.inbound.get('in_01')
```

CLI:

```bash
opensend inbound get in_01
```

Answer:

```json
{
  "object": "inbound_email",
  "id": "in_01",
  "from": "grace@customer.example",
  "fromName": "Grace Hopper",
  "to": "support@mail.example.com",
  "subject": "A question about my invoice",
  "domain": "mail.example.com",
  "spam": false,
  "size": 48920,
  "attachments": 1,
  "createdAt": "2026-11-27T09:30:00.000Z",
  "text": "Hello, could you send the invoice for November again? Thanks, Grace",
  "html": "<p>Hello, could you send the invoice for November again?</p><p>Thanks, Grace</p>",
  "truncated": false,
  "messageId": "<b7f1c2d4@mail.customer.example>",
  "files": [
    {
      "filename": "invoice-october.pdf",
      "mimeType": "application/pdf",
      "size": 41213
    }
  ]
}
```
