> ## Documentation Index
> Fetch the complete documentation index at: https://deepline.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Unipile: Get Email

> Get one email (headers, body, attachments metadata) from a connected mailbox by email_id. Includes inputs, outputs, SDK V2 examples, and Deepline cost.

Get one email (headers, body, attachments metadata) from a connected mailbox by email\_id.

> [!NOTE]
>
> Tool ID: `unipile_get_email`

## Run this action

Use the TypeScript SDK for one call. Use `ctx.tools.execute(...)` inside a Play for durable calls, scheduled calls, or CSV processing.

```ts theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
import { Deepline } from 'deepline';

const deepline = await Deepline.connect();
const result = await deepline.tools.execute(
  'unipile_get_email',
  {
    "email_id": "jane.doe@example.com"
  },
);

console.log(result.toolResponse.raw);
```

### CLI

```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
deepline tools execute unipile_get_email --input '{
  "email_id": "jane.doe@example.com"
}' --json
```

## Example response

The static output schema lacks the details for a reliable example. Use `deepline describe unipile_get_email --json` for the complete live contract.

## Input reference

Retrieve the details of an email.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `payload.email_id` | `string` | Yes | — | The id of the email to be retrieved. Either the Unipile id or the provider uid. |
| `payload.account_id` | `string` | No | — | The id of the account related to the email. Required when using the provider uid. |
| `payload.include_headers` | `boolean` | No | — | Include the email headers in the response. |

<details>
  <summary>Show raw input schema</summary>

  ### Input JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "description": "Retrieve the details of an email.",
    "properties": {
      "email_id": {
        "type": "string",
        "description": "The id of the email to be retrieved. Either the Unipile id or the provider uid."
      },
      "account_id": {
        "type": "string",
        "description": "The id of the account related to the email. Required when using the provider uid."
      },
      "include_headers": {
        "type": "boolean",
        "description": "Include the email headers in the response."
      }
    },
    "required": [
      "email_id"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Output reference

Standard tool result payload.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `result.data` | `object` | Yes | — | @todo Email |
| `result.data.object` | `"Email"` | Yes | — | — |
| `result.data.id` | `string` | Yes | — | A unique identifier. |
| `result.data.deprecated_id` | `string` | Yes | — | A unique identifier. |
| `result.data.kind` | `"0_ref"` | Yes | — | — |
| `result.data.account_id` | `string` | Yes | — | A unique identifier. |
| `result.data.type` | `"MAIL" \| "GOOGLE" \| "ICLOUD" \| "OUTLOOK" \| "EXCHANGE" \| "GOOGLE_OAUTH"` | Yes | — | — |
| `result.data.date` | `unknown` | Yes | — | An ISO 8601 UTC datetime (YYYY-MM-DDTHH:MM:SS.sssZ). ⚠️ All links expire upon daily restart, regardless of their stated expiration date. A new link must be generated each time a user clicks on your app to connect. |
| `result.data.role` | `"inbox" \| "sent" \| "archive" \| "drafts" \| "trash" \| "spam" \| "all" \| "important" \| "starred" \| "unknown"` | Yes | — | — |
| `result.data.folders` | `array` | Yes | — | — |
| `result.data.folderIds` | `array` | Yes | — | — |
| `result.data.read_date` | `unknown \| null` | No | — | — |
| `result.data.message_id` | `string` | Yes | — | — |
| `result.data.provider_id` | `string` | Yes | — | — |
| `result.data.body_plain` | `""` | Yes | — | — |
| `result.data.body` | `""` | Yes | — | — |
| `result.data.from_attendee` | `object` | Yes | — | — |
| `result.data.from_attendee.display_name` | `string` | No | — | — |
| `result.data.from_attendee.profile_picture` | `string` | No | — | — |
| `result.data.from_attendee.identifier` | `string` | Yes | — | — |
| `result.data.from_attendee.identifier_type` | `"CHAT_ATTENDEE_ID" \| "PHONE_NUMBER" \| "EMAIL_ADDRESS" \| "MESSENGER_ID" \| "MESSENGER_THREAD_ID" \| "TIKTOK_ID" \| "TIKTOK_THREAD_ID" \| "TWITTER_ID" \| "TWITTER_THREAD_ID" \| "INSTAGRAM_ID" \| "INSTAGRAM_THREAD_ID" \| "LINKEDIN_ID" \| "LINKEDIN_THREAD_ID" \| "GROUP_THREAD"` | Yes | — | — |
| `result.data.to_attendees` | `array` | No | — | — |
| `result.data.to_attendees[].display_name` | `string` | No | — | — |
| `result.data.to_attendees[].profile_picture` | `string` | No | — | — |
| `result.data.to_attendees[].identifier` | `string` | Yes | — | — |
| `result.data.to_attendees[].identifier_type` | `"CHAT_ATTENDEE_ID" \| "PHONE_NUMBER" \| "EMAIL_ADDRESS" \| "MESSENGER_ID" \| "MESSENGER_THREAD_ID" \| "TIKTOK_ID" \| "TIKTOK_THREAD_ID" \| "TWITTER_ID" \| "TWITTER_THREAD_ID" \| "INSTAGRAM_ID" \| "INSTAGRAM_THREAD_ID" \| "LINKEDIN_ID" \| "LINKEDIN_THREAD_ID" \| "GROUP_THREAD"` | Yes | — | — |
| `result.data.cc_attendees` | `array` | No | — | — |
| `result.data.cc_attendees[].display_name` | `string` | No | — | — |
| `result.data.cc_attendees[].profile_picture` | `string` | No | — | — |
| `result.data.cc_attendees[].identifier` | `string` | Yes | — | — |
| `result.data.cc_attendees[].identifier_type` | `"CHAT_ATTENDEE_ID" \| "PHONE_NUMBER" \| "EMAIL_ADDRESS" \| "MESSENGER_ID" \| "MESSENGER_THREAD_ID" \| "TIKTOK_ID" \| "TIKTOK_THREAD_ID" \| "TWITTER_ID" \| "TWITTER_THREAD_ID" \| "INSTAGRAM_ID" \| "INSTAGRAM_THREAD_ID" \| "LINKEDIN_ID" \| "LINKEDIN_THREAD_ID" \| "GROUP_THREAD"` | Yes | — | — |
| `result.data.bcc_attendees` | `array` | No | — | — |
| `result.data.bcc_attendees[].display_name` | `string` | No | — | — |
| `result.data.bcc_attendees[].profile_picture` | `string` | No | — | — |
| `result.data.bcc_attendees[].identifier` | `string` | Yes | — | — |
| `result.data.bcc_attendees[].identifier_type` | `"CHAT_ATTENDEE_ID" \| "PHONE_NUMBER" \| "EMAIL_ADDRESS" \| "MESSENGER_ID" \| "MESSENGER_THREAD_ID" \| "TIKTOK_ID" \| "TIKTOK_THREAD_ID" \| "TWITTER_ID" \| "TWITTER_THREAD_ID" \| "INSTAGRAM_ID" \| "INSTAGRAM_THREAD_ID" \| "LINKEDIN_ID" \| "LINKEDIN_THREAD_ID" \| "GROUP_THREAD"` | Yes | — | — |
| `result.data.reply_to_attendees` | `array` | No | — | — |
| `result.data.reply_to_attendees[].display_name` | `string` | No | — | — |
| `result.data.reply_to_attendees[].profile_picture` | `string` | No | — | — |
| `result.data.reply_to_attendees[].identifier` | `string` | Yes | — | — |
| `result.data.reply_to_attendees[].identifier_type` | `"CHAT_ATTENDEE_ID" \| "PHONE_NUMBER" \| "EMAIL_ADDRESS" \| "MESSENGER_ID" \| "MESSENGER_THREAD_ID" \| "TIKTOK_ID" \| "TIKTOK_THREAD_ID" \| "TWITTER_ID" \| "TWITTER_THREAD_ID" \| "INSTAGRAM_ID" \| "INSTAGRAM_THREAD_ID" \| "LINKEDIN_ID" \| "LINKEDIN_THREAD_ID" \| "GROUP_THREAD"` | Yes | — | — |
| `result.data.subject` | `string` | Yes | — | — |
| `result.data.has_attachments` | `boolean` | Yes | — | — |
| `result.data.origin` | `"unipile" \| "external"` | Yes | — | — |
| `result.data.in_reply_to` | `object` | No | — | — |
| `result.data.in_reply_to.message_id` | `string` | Yes | — | — |
| `result.data.in_reply_to.id` | `string` | Yes | — | A unique identifier. |
| `result.data.tracking_id` | `string` | No | — | — |
| `result.data.thread_id` | `string` | No | — | — |
| `result.data.attachments` | `array` | Yes | — | — |

The table shows the first 50 fields. Use the live contract below for every field.

> [!NOTE]
>
> This output schema is too large for an inline display. Read the complete live contract with `deepline describe unipile_get_email --json`.

## Deepline cost

* Pricing model: `fixed` (per call).
* Estimated Deepline credits: `0` per pricing unit.
* Provider-native pricing may still exist outside Deepline credit billing.

## Related documentation

* [Unipile provider guide](https://deepline.com/docs/providers/unipile/guide.md)
* [SDK V2 quickstart](https://deepline.com/docs/sdk-v2/quickstart.md)
* [SDK reference](https://deepline.com/docs/sdk-v2/sdk-reference.md)
* [Run tools across a CSV](https://deepline.com/docs/sdk-v2/batch-csv.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.