# Emails API

> Send email, look up messages and their content, and schedule, cancel, retry or forward them.

Base URL: `https://api.emailit.com/v2`. Authenticate with `Authorization: Bearer <API key>`.

## Send an email — POST /emails

> Send an email to one or more recipients with HTML or text, a template, attachments, custom headers, metadata, scheduling and tracking.

# Send an email

Sends an email from a verified sending domain. Every recipient gets a separate copy with its own email ID, and each recipient costs one credit.

`POST /emails`

Works with `sending` and `full` API keys. Sends count against the workspace's [sending limits](/docs/api-reference/rate-limits/), and a successful response means the email is accepted and queued, not yet delivered. Track delivery with [webhooks](/docs/webhooks/) or [Retrieve an email](/docs/api-reference/emails/get/). Unverified workspaces can only send to their members' account emails.

## Headers

- `Idempotency-Key` (string): A unique key, up to 256 letters, digits, `-` and `_`. A retry with the same key within 24 hours returns the first response instead of sending again. See [Idempotency](/docs/api-reference/idempotency/).

## Body parameters

- `from` (string, required): The sender, as `hello@acme.com` or `Acme <hello@acme.com>`. The address must be on a verified sending domain of the workspace, and on the key's domain if the key is [restricted to one](/docs/api-reference/authentication/#restrict-a-key-to-one-domain).

- `to` (string | string[], required): Recipients, as an array or a comma-separated string. Each entry can be `ada@example.com` or `Ada Lovelace <ada@example.com>`. Up to 50.

- `cc` (string | string[]): Copy recipients. Up to 50.

- `bcc` (string | string[]): Blind copy recipients. Up to 50. They don't appear in the message headers.

- `reply_to` (string | string[]): Addresses for replies. If you send with a template and omit this, the template's reply-to is used.

- `subject` (string): The subject line. Required unless `template` provides one.

- `html` (string): The HTML body. You need `html`, `text` or both, unless `template` provides content.

- `text` (string): The plain-text body. When you send both `html` and `text`, recipients get a multipart message.

- `template` (string): A template to send. Pass a template ID (`tem_…`) to use that exact version, or an alias to use its published version. `subject`, `html` and `text` in the request override the template's. See [Templates](/docs/templates/).

- `variables` (object): Values for [Temple](/docs/templates/temple/) placeholders such as `{{first_name}}`, rendered in the subject, HTML and text. Works with templates and with inline content.

- `attachments` (object[]): Files to attach. See [Attachment object](#attachment-object) below.

- `headers` (object): Extra MIME headers as name–value pairs, for example `{"List-Unsubscribe": "<https://acme.com/unsubscribe>"}`. Emailit sets `Message-ID` itself.

- `meta` (object): Your own key–value data, for example `{"order_id": "1042"}`. Values must be strings. Stored with the email and included in reads and webhook payloads.

- `scheduled_at` (string): When to send, as an ISO 8601 date-time such as `2026-10-02T09:00:00Z`, or in English such as `tomorrow at 9am`. Include a time zone in ISO 8601 values. A time in the past, or a value that can't be parsed (including a Unix timestamp), sends the email right away. Scheduled emails have the status `scheduled` until they're sent.

- `tracking` (boolean | object): Turns open and click tracking on or off for this email: `true`, `false`, or `{"loads": true, "clicks": false}`. Defaults to the sending domain's settings. Tracking only works when the domain's [tracking CNAME](/docs/tracking/custom-tracking-domain/) is verified; otherwise it's off and the response shows `false`.

### Attachment object

- `filename` (string, required): The file name, including an allowed extension (see below).

- `content` (string): The file, Base64-encoded. Send `content` or `url`, not both.

- `url` (string): A public `http` or `https` URL to download the file from. Emailit fetches it when you send: the download must finish within 30 seconds, be at most 25 MB, and must not redirect.

- `content_type` (string): The MIME type, such as `application/pdf`. Required with `content`. With `url`, defaults to the type the server returns.

- `content_id` (string): Makes the attachment inline. Reference it in the HTML as `<img src="cid:logo">` when `content_id` is `logo`.

- `encoding` (string): The encoding of `content`, such as `base64` or `hex`.

The whole message, including attachments, can be up to 40 MB. These file types are allowed:

| Category | Extensions |
| --- | --- |
| Text | `.txt`, `.csv`, `.log`, `.css`, `.ics`, `.xml` |
| Images | `.jpg`, `.jpe`, `.jpeg`, `.gif`, `.png`, `.bmp`, `.psd`, `.tif`, `.tiff`, `.svg`, `.indd`, `.ai`, `.eps` |
| Documents | `.doc`, `.docx`, `.rtf`, `.odt`, `.ott`, `.pdf`, `.pub`, `.pages`, `.mobi`, `.epub` |
| Audio | `.mp3`, `.m4a`, `.m4v`, `.wma`, `.ogg`, `.flac`, `.wav`, `.aif`, `.aifc`, `.aiff` |
| Video | `.mp4`, `.mov`, `.avi`, `.mkv`, `.mpeg`, `.mpg`, `.wmv` |
| Spreadsheets | `.xls`, `.xlsx`, `.ods`, `.numbers` |
| Presentations | `.odp`, `.ppt`, `.pptx`, `.pps`, `.key` |
| Archives | `.zip`, `.vcf` |
| Email | `.eml` |
| Cryptographic | `.p7c`, `.p7m`, `.p7s`, `.pgp`, `.asc`, `.sig` |

## Returns

Returns `200` with the email object of the first recipient. When the message has more than one recipient across `to`, `cc` and `bcc`, `ids` maps every recipient to the ID of their copy. Each copy fires an [`email.accepted`](/docs/webhooks/events/email/accepted/) or [`email.scheduled`](/docs/webhooks/events/email/scheduled/) event.

- `object` (string): Always `email`.

- `id` (string): The ID of the first recipient's email.

- `ids` (object): Recipient address to email ID, for every recipient. Only present with more than one recipient.

- `token` (string): The first email's internal token.

- `message_id` (string): The first email's `Message-ID` header, such as `<token@acme.com>`.

- `from` (string): The sender, as you sent it.

- `to` (string[]): The `to` addresses, without display names or duplicates.

- `cc` (string[]): The `cc` recipients. Only present when you sent some.

- `bcc` (string[]): The `bcc` recipients. Only present when you sent some.

- `subject` (string): The subject, after template and variable rendering.

- `status` (string): `accepted`, or `scheduled` for a future `scheduled_at`.

- `scheduled_at` (string | null): When the email will be sent, or `null`.

- `created_at` (string): When the email was accepted.

- `tracking` (object): The tracking that applies: `loads` and `clicks` booleans.

**Request** `POST /emails`

**Node.js**

```javascript
import { Emailit } from '@emailit/node';
const emailit = new Emailit('your_api_key');

const email = await emailit.emails.send({
  from: 'Acme <hello@acme.com>',
  to: ['ada@example.com', 'grace@example.com'],
  subject: 'Welcome to Acme',
  html: '<h1>Welcome!</h1><p>Thanks for signing up.</p>',
  tracking: {
    loads: true,
    clicks: true,
  },
});
```

**Python**

```python
from emailit import EmailitClient
client = EmailitClient("your_api_key")

email = client.emails.send({
  "from": "Acme <hello@acme.com>",
  "to": ["ada@example.com", "grace@example.com"],
  "subject": "Welcome to Acme",
  "html": "<h1>Welcome!</h1><p>Thanks for signing up.</p>",
  "tracking": {
    "loads": True,
    "clicks": True
  }
})
```

**PHP**

```php
$emailit = Emailit::client('your_api_key');

$email = $emailit->emails()->send([
  'from' => 'Acme <hello@acme.com>',
  'to' => ['ada@example.com', 'grace@example.com'],
  'subject' => 'Welcome to Acme',
  'html' => '<h1>Welcome!</h1><p>Thanks for signing up.</p>',
  'tracking' => [
    'loads' => true,
    'clicks' => true,
  ],
]);
```

**Ruby**

```ruby
require "emailit"
client = Emailit::EmailitClient.new("your_api_key")

email = client.emails.send(
  from: "Acme <hello@acme.com>",
  to: ["ada@example.com", "grace@example.com"],
  subject: "Welcome to Acme",
  html: "<h1>Welcome!</h1><p>Thanks for signing up.</p>",
  tracking: { loads: true, clicks: true }
)
```

**Go**

```go
import "github.com/emailit/emailit-go/v2"
client := emailit.NewClient("your_api_key")

email, err := client.Emails.Send(&emailit.SendEmailRequest{
  From:    "Acme <hello@acme.com>",
  To:      []string{"ada@example.com", "grace@example.com"},
  Subject: "Welcome to Acme",
  Html:    "<h1>Welcome!</h1><p>Thanks for signing up.</p>",
  Tracking: &emailit.TrackingOptions{
    Loads:  true,
    Clicks: true,
  },
})
```

**Rust**

```rust
use emailit::Emailit;
use emailit::types::CreateEmailBaseOptions;

let emailit = Emailit::new("your_api_key");

let opts = CreateEmailBaseOptions::new(
    "Acme <hello@acme.com>",
    ["ada@example.com", "grace@example.com"],
    "Welcome to Acme",
)
.with_html("<h1>Welcome!</h1><p>Thanks for signing up.</p>")
.with_tracking(true, true);

let email = emailit.emails.send(opts).await?;
```

**Java**

```java
import com.emailit.*;
import com.emailit.params.*;

EmailitClient emailit = new EmailitClient("your_api_key");

EmailitObject email = emailit.emails().send(
  EmailSendParams.builder()
    .setFrom("Acme <hello@acme.com>")
    .setTo(Arrays.asList("ada@example.com", "grace@example.com"))
    .setSubject("Welcome to Acme")
    .setHtml("<h1>Welcome!</h1><p>Thanks for signing up.</p>")
    .setTracking(new TrackingOptions(true, true))
    .build()
);
```

**.NET**

```csharp
using Emailit;

var emailit = new EmailitClient("your_api_key");

var email = emailit.Emails.Send(new EmailSendOptions {
  From = "Acme <hello@acme.com>",
  To = new[] { "ada@example.com", "grace@example.com" },
  Subject = "Welcome to Acme",
  Html = "<h1>Welcome!</h1><p>Thanks for signing up.</p>",
  Tracking = new TrackingOptions { Loads = true, Clicks = true },
});
```

**Laravel**

```php
use Emailit\Laravel\Facades\Emailit;

$email = Emailit::emails()->send([
  'from' => 'Acme <hello@acme.com>',
  'to' => ['ada@example.com', 'grace@example.com'],
  'subject' => 'Welcome to Acme',
  'html' => '<h1>Welcome!</h1><p>Thanks for signing up.</p>',
  'tracking' => [
    'loads' => true,
    'clicks' => true,
  ],
]);
```

**cURL**

```bash
curl -X POST https://api.emailit.com/v2/emails \
  -H "Authorization: Bearer $EMAILIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "Acme <hello@acme.com>",
    "to": ["ada@example.com", "grace@example.com"],
    "subject": "Welcome to Acme",
    "html": "<h1>Welcome!</h1><p>Thanks for signing up.</p>",
    "tracking": {
      "loads": true,
      "clicks": true
    }
  }'
```

**cURL**

```bash
curl -X POST https://api.emailit.com/v2/emails \
  -H "Authorization: Bearer $EMAILIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "Acme <hello@acme.com>",
    "to": "ada@example.com",
    "template": "welcome",
    "variables": {
      "first_name": "Ada",
      "activation_url": "https://acme.com/activate?token=8f2c1e"
    }
  }'
```

**Node.js**

```javascript
const email = await emailit.emails.send({
  from: 'Acme <hello@acme.com>',
  to: 'ada@example.com',
  template: 'welcome',
  variables: {
    first_name: 'Ada',
    activation_url: 'https://acme.com/activate?token=8f2c1e',
  },
});
```

**Python**

```python
email = client.emails.send({
  "from": "Acme <hello@acme.com>",
  "to": "ada@example.com",
  "template": "welcome",
  "variables": {
    "first_name": "Ada",
    "activation_url": "https://acme.com/activate?token=8f2c1e"
  }
})
```

**cURL**

```bash
curl -X POST https://api.emailit.com/v2/emails \
  -H "Authorization: Bearer $EMAILIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "Acme Billing <billing@acme.com>",
    "to": "ada@example.com",
    "subject": "Your invoice INV-1042",
    "html": "<img src=\"cid:logo\"><p>Your invoice is attached.</p>",
    "attachments": [
      {
        "filename": "INV-1042.pdf",
        "content": "JVBERi0xLjQKJcOkw7zDqc...",
        "content_type": "application/pdf"
      },
      {
        "filename": "logo.png",
        "url": "https://acme.com/assets/logo.png",
        "content_id": "logo"
      }
    ]
  }'
```

**Node.js**

```javascript
import { readFile } from 'node:fs/promises';

const pdf = await readFile('INV-1042.pdf');

const email = await emailit.emails.send({
  from: 'Acme Billing <billing@acme.com>',
  to: 'ada@example.com',
  subject: 'Your invoice INV-1042',
  html: '<img src="cid:logo"><p>Your invoice is attached.</p>',
  attachments: [
    {
      filename: 'INV-1042.pdf',
      content: pdf.toString('base64'),
      content_type: 'application/pdf',
    },
    {
      filename: 'logo.png',
      url: 'https://acme.com/assets/logo.png',
      content_id: 'logo',
    },
  ],
});
```

**Python**

```python
import base64

with open("INV-1042.pdf", "rb") as f:
    pdf = base64.b64encode(f.read()).decode()

email = client.emails.send({
  "from": "Acme Billing <billing@acme.com>",
  "to": "ada@example.com",
  "subject": "Your invoice INV-1042",
  "html": '<img src="cid:logo"><p>Your invoice is attached.</p>',
  "attachments": [
    {"filename": "INV-1042.pdf", "content": pdf, "content_type": "application/pdf"},
    {"filename": "logo.png", "url": "https://acme.com/assets/logo.png", "content_id": "logo"}
  ]
})
```

**cURL**

```bash
curl -X POST https://api.emailit.com/v2/emails \
  -H "Authorization: Bearer $EMAILIT_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: reminder-appt-5531" \
  -d '{
    "from": "Acme <reminders@acme.com>",
    "to": "ada@example.com",
    "subject": "Your appointment tomorrow",
    "text": "See you tomorrow at 2 PM.",
    "scheduled_at": "2026-10-02T09:00:00Z",
    "meta": { "appointment_id": "5531" }
  }'
```

**Node.js**

```javascript
const email = await emailit.emails.send({
  from: 'Acme <reminders@acme.com>',
  to: 'ada@example.com',
  subject: 'Your appointment tomorrow',
  text: 'See you tomorrow at 2 PM.',
  scheduled_at: '2026-10-02T09:00:00Z',
  meta: { appointment_id: '5531' },
});
```

**Python**

```python
email = client.emails.send({
  "from": "Acme <reminders@acme.com>",
  "to": "ada@example.com",
  "subject": "Your appointment tomorrow",
  "text": "See you tomorrow at 2 PM.",
  "scheduled_at": "2026-10-02T09:00:00Z",
  "meta": {"appointment_id": "5531"}
})
```

**200**

```json
{
  "object": "email",
  "id": "em_4KYof1ZzXndZE2VPi0DgULiekG8",
  "ids": {
    "ada@example.com": "em_4KYof1ZzXndZE2VPi0DgULiekG8",
    "grace@example.com": "em_4KfIXZSV8v8L1k0Mg2YDR3rytvj"
  },
  "token": "4KDY1iIpQSSW5pAoiz3JEfqcsO0",
  "message_id": "<4KDY1iIpQSSW5pAoiz3JEfqcsO0@acme.com>",
  "from": "Acme <hello@acme.com>",
  "to": ["ada@example.com", "grace@example.com"],
  "subject": "Welcome to Acme",
  "status": "accepted",
  "scheduled_at": null,
  "created_at": "2026-10-01T09:30:12.482913Z",
  "tracking": {
    "loads": true,
    "clicks": true
  }
}
```

**200 Scheduled**

```json
{
  "object": "email",
  "id": "em_4K76IA5sFNIsLXW9QC2ro8cDbOj",
  "token": "4KWzEED2cnej6UMjF4v508VqQIp",
  "message_id": "<4KWzEED2cnej6UMjF4v508VqQIp@acme.com>",
  "from": "Acme <reminders@acme.com>",
  "to": ["ada@example.com"],
  "subject": "Your appointment tomorrow",
  "status": "scheduled",
  "scheduled_at": "2026-10-02T09:00:00.000Z",
  "created_at": "2026-10-01T09:30:12.482913Z",
  "tracking": {
    "loads": false,
    "clicks": false
  }
}
```

**400**

```json
{
  "error": "Validation failed",
  "validation_errors": [
    "Missing required field: subject",
    "Invalid to email address at index 1: grace@example"
  ]
}
```

**402**

```json
{
  "error": "Insufficient credits",
  "message": "Insufficient credits to send this email. Required: 2, available: 0."
}
```

**403 Unverified**

```json
{
  "code": "unverified_workspace_recipient",
  "error": "Workspace not verified",
  "message": "Unverified workspaces can only send to workspace members' account emails. Blocked recipient: grace@example.com.",
  "blocked_recipients": ["grace@example.com"]
}
```

**403 Domain**

```json
{
  "error": "Domain not authorized",
  "message": "API key is not authorized to send from this domain"
}
```

**404**

```json
{
  "error": "Template not found",
  "message": "Template 'welcome' not found or not published"
}
```

**413**

```json
{
  "error": "Message too large",
  "message": "Message size (41.27MB) exceeds maximum allowed size of 40MB"
}
```

**422**

```json
{
  "error": "Domain not verified"
}
```

**429**

```json
{
  "error": "Rate limit exceeded",
  "message": "Too many requests. Maximum 2 messages per second allowed.",
  "limit": 2,
  "current": 2,
  "retry_after": 1
}
```

---
Source: https://emailit.com/docs/api-reference/emails/send/

## List emails — GET /emails

> List the outgoing or inbound emails of a workspace, newest first, with search, filters, sorting and a default 14-day window.

# List emails

Returns a page of emails, newest first. By default the list shows outgoing emails from the last 14 days.

`GET /emails`

Requires a `full` API key. Each recipient of a send is a separate email in this list.

## Query parameters

- `page` (integer): The page to return.

- `limit` (integer): Emails per page, from 1 to 100.

- `type` (string): `outbound` for emails you sent, or `inbound` for emails you [received](/docs/inbound/).

- `date_from` (string): Only emails created on or after this date, such as `2026-08-01` (from 00:00 UTC). Without it, the list starts 14 days ago. `created_at` filters don't change this window.

- `date_to` (string): Only emails created on or before this date, up to 23:59:59 UTC.

- `search` (string): Case-insensitive match on the recipient, sender or subject.

- `match` (string): `all` or `or`. How the filters below combine.

- `order` (string): A sort key from the table below.

- `direction` (string): `asc` or `desc`.

## Filters

Add filters as `key.condition=value`, for example `status.exact=bounced` or `created_at.after=2026-09-01`. See [Filtering](/docs/api-reference/filtering/) for the conditions of each type.

| Key | Type | Values and notes |
| --- | --- | --- |
| `to` | string | Recipient address. |
| `from` | string | Sender as sent, including any display name. |
| `subject` | string | |
| `status` | enum | `accepted`, `scheduled`, `delivered`, `loaded`, `clicked`, `attempted`, `bounced`, `failed`, `rejected`, `suppressed`, `received`, `complained`, `canceled`, `held` |
| `tag` | string | The email's tag. Sending through the API or SMTP doesn't set a tag at the moment. |
| `spam_score` | number | |
| `created_at` | date | |
| `updated_at` | date | |
| `api_key_id` | string | ID of the API key that sent the email (`key_…`). |
| `sending_domain_id` | string | ID of the sending domain (`dom_…`). |

Every key is also a sort key. The older `status`, `rcpt_to`, `mail_from`, `subject`, `api_key_id` and `sending_domain_id` query parameters still work: `status` matches exactly and the address and subject parameters match partially.

## Returns

Returns a `data` array of email objects with `next_page_url` and `previous_page_url`. See [Pagination](/docs/api-reference/pagination/). The page URLs don't carry your filters, so request the next page with your own parameters and `page` increased by one.

- `object` (string): Always `email`.

- `id` (string): The email ID.

- `type` (string): `outbound` or `inbound`.

- `from` (string): The sender as sent.

- `to` (string): The recipient of this copy.

- `subject` (string): The subject.

- `status` (string): The current [status](/docs/logs/email-statuses/).

- `size` (integer): Size of the message in bytes.

- `scheduled_at` (string | null): When a scheduled email is due, or `null`.

- `created_at` (string): When the email was accepted or received.

- `updated_at` (string): When the status last changed.

- `meta` (object | null): The `meta` you sent.

**Request** `GET /emails`

**Node.js**

```javascript
import { Emailit } from '@emailit/node';
const emailit = new Emailit('your_api_key');

const emails = await emailit.emails.list({ page: 1, limit: 25 });
```

**Python**

```python
from emailit import EmailitClient
client = EmailitClient("your_api_key")

emails = client.emails.list({ "page": 1, "limit": 25 })
```

**PHP**

```php
$emailit = Emailit::client('your_api_key');

$emails = $emailit->emails()->list(['page' => 1, 'limit' => 25]);
```

**Ruby**

```ruby
require "emailit"
client = Emailit::EmailitClient.new("your_api_key")

emails = client.emails.list(page: 1, limit: 25)
```

**Go**

```go
import "github.com/emailit/emailit-go/v2"
client := emailit.NewClient("your_api_key")

emails, err := client.Emails.List(&emailit.ListEmailsRequest{
  Page:  1,
  Limit: 25,
})
```

**Rust**

```rust
use emailit::Emailit;

let emailit = Emailit::new("your_api_key");

let emails = emailit.emails.list(Some(emailit::types::ListEmailsParams {
  page: Some(1),
  limit: Some(25),
})).await?;
```

**Java**

```java
import com.emailit.*;
import com.emailit.params.*;

EmailitClient emailit = new EmailitClient("your_api_key");

EmailitObject emails = emailit.emails().list(
  EmailListParams.builder()
    .setPage(1)
    .setLimit(25)
    .build()
);
```

**.NET**

```csharp
using Emailit;

var emailit = new EmailitClient("your_api_key");

var emails = emailit.Emails.List(new EmailListOptions {
  Page = 1,
  Limit = 25,
});
```

**Laravel**

```php
use Emailit\Laravel\Facades\Emailit;

$emails = Emailit::emails()->list(['page' => 1, 'limit' => 25]);
```

**cURL**

```bash
curl -G https://api.emailit.com/v2/emails \
  -H "Authorization: Bearer $EMAILIT_API_KEY" \
  -d page=1 \
  -d limit=25
```

**cURL**

```bash
curl -G https://api.emailit.com/v2/emails \
  -H "Authorization: Bearer $EMAILIT_API_KEY" \
  -d status.exact=bounced \
  -d status.exact=failed \
  -d match=or \
  -d date_from=2026-09-01 \
  -d order=created_at \
  -d direction=desc
```

**200**

```json
{
  "data": [
    {
      "object": "email",
      "id": "em_4KYof1ZzXndZE2VPi0DgULiekG8",
      "type": "outbound",
      "from": "Acme <hello@acme.com>",
      "to": "ada@example.com",
      "subject": "Welcome to Acme",
      "status": "delivered",
      "size": 4523,
      "scheduled_at": null,
      "created_at": "2026-10-01T09:30:12.482913Z",
      "updated_at": "2026-10-01T09:30:14.118204Z",
      "meta": null
    },
    {
      "object": "email",
      "id": "em_4KfIXZSV8v8L1k0Mg2YDR3rytvj",
      "type": "outbound",
      "from": "Acme <hello@acme.com>",
      "to": "grace@example.com",
      "subject": "Welcome to Acme",
      "status": "loaded",
      "size": 4527,
      "scheduled_at": null,
      "created_at": "2026-10-01T09:30:12.482913Z",
      "updated_at": "2026-10-01T09:41:03.770521Z",
      "meta": null
    }
  ],
  "next_page_url": "/app/v2/emails?page=2&limit=25",
  "previous_page_url": null
}
```

**400**

```json
{
  "statusCode": 400,
  "error": "Bad Request",
  "message": "Validation error",
  "details": [
    {
      "instancePath": "/limit",
      "schemaPath": "#/properties/limit/maximum",
      "keyword": "maximum",
      "params": { "comparison": "<=", "limit": 100 },
      "message": "must be <= 100"
    }
  ]
}
```

---
Source: https://emailit.com/docs/api-reference/emails/list/

## Retrieve an email — GET /emails/{id}

> Retrieve one outgoing or inbound email by ID with its status, headers, parsed HTML and text body, metadata and attachments.

# Retrieve an email

Retrieves an email with its status, parsed headers, HTML and text body, and attachments.

`GET /emails/{id}`

Requires a `full` API key. Message content is kept for your plan's content [retention period](/docs/data-retention/). After that, `headers`, `body` and `attachments` are empty, and the status and metadata remain. To fetch only part of an email, use [Retrieve the body](/docs/api-reference/emails/body/), [Retrieve metadata](/docs/api-reference/emails/meta/), [List attachments](/docs/api-reference/emails/attachments/) or [Retrieve raw MIME](/docs/api-reference/emails/raw/).

## Path parameters

- `id` (string, required): The email ID, such as `em_4KYof1ZzXndZE2VPi0DgULiekG8`.

## Returns

Returns the email object.

- `object` (string): Always `email`.

- `id` (string): The email ID.

- `type` (string): `outbound` for emails you sent, `inbound` for emails you received.

- `token` (string): The email's internal token.

- `message_id` (string): The `Message-ID` header.

- `from` (string): The sender as sent, such as `Acme <hello@acme.com>`.

- `to` (string): The recipient of this copy.

- `subject` (string): The subject.

- `status` (string): The current status: `accepted`, `scheduled`, `delivered`, `loaded`, `clicked`, `attempted`, `bounced`, `failed`, `rejected`, `suppressed`, `received`, `complained`, `canceled` or `held`. See [Email statuses](/docs/logs/email-statuses/).

- `size` (integer): Size of the message in bytes.

- `scheduled_at` (string | null): When a scheduled email is due, or `null`.

- `created_at` (string): When the email was accepted or received.

- `updated_at` (string): When the email last changed.

- `tracking` (object): Outbound only. Whether open (`loads`) and click (`clicks`) tracking is on.

- `meta` (object | null): The `meta` you sent, or `null`.

- `headers` (object | null): The message headers as name–value pairs, or `null` once the content is purged.

- `body` (object): `text` and `html`, each a string or `null`.

- `attachments` (object[]): The attachments, each with `filename`, `content_type`, `size` in bytes, `content_id` (for inline files), `content_disposition` (`attachment` or `inline`) and `content` (Base64).

**Request** `GET /emails/{id}`

**Node.js**

```javascript
import { Emailit } from '@emailit/node';
const emailit = new Emailit('your_api_key');

const email = await emailit.emails.get('em_4KYof1ZzXndZE2VPi0DgULiekG8');
```

**Python**

```python
from emailit import EmailitClient
client = EmailitClient("your_api_key")

email = client.emails.get("em_4KYof1ZzXndZE2VPi0DgULiekG8")
```

**PHP**

```php
$emailit = Emailit::client('your_api_key');

$email = $emailit->emails()->get('em_4KYof1ZzXndZE2VPi0DgULiekG8');
```

**Ruby**

```ruby
require "emailit"
client = Emailit::EmailitClient.new("your_api_key")

email = client.emails.get("em_4KYof1ZzXndZE2VPi0DgULiekG8")
```

**Go**

```go
import "github.com/emailit/emailit-go/v2"
client := emailit.NewClient("your_api_key")

email, err := client.Emails.Get("em_4KYof1ZzXndZE2VPi0DgULiekG8")
```

**Rust**

```rust
use emailit::Emailit;

let emailit = Emailit::new("your_api_key");

let email = emailit.emails.get("em_4KYof1ZzXndZE2VPi0DgULiekG8").await?;
```

**Java**

```java
import com.emailit.*;

EmailitClient emailit = new EmailitClient("your_api_key");

EmailitObject email = emailit.emails().get("em_4KYof1ZzXndZE2VPi0DgULiekG8");
```

**.NET**

```csharp
using Emailit;

var emailit = new EmailitClient("your_api_key");

var email = emailit.Emails.Get("em_4KYof1ZzXndZE2VPi0DgULiekG8");
```

**Laravel**

```php
use Emailit\Laravel\Facades\Emailit;

$email = Emailit::emails()->get('em_4KYof1ZzXndZE2VPi0DgULiekG8');
```

**cURL**

```bash
curl https://api.emailit.com/v2/emails/em_4KYof1ZzXndZE2VPi0DgULiekG8 \
  -H "Authorization: Bearer $EMAILIT_API_KEY"
```

**200 Outbound**

```json
{
  "object": "email",
  "id": "em_4KYof1ZzXndZE2VPi0DgULiekG8",
  "type": "outbound",
  "token": "4KDY1iIpQSSW5pAoiz3JEfqcsO0",
  "message_id": "<4KDY1iIpQSSW5pAoiz3JEfqcsO0@acme.com>",
  "from": "Acme Billing <billing@acme.com>",
  "to": "ada@example.com",
  "subject": "Your invoice INV-1042",
  "status": "delivered",
  "size": 48213,
  "scheduled_at": null,
  "created_at": "2026-10-01T09:30:12.482913Z",
  "updated_at": "2026-10-01T09:30:14.118204Z",
  "tracking": {
    "loads": true,
    "clicks": true
  },
  "meta": {
    "invoice_id": "INV-1042"
  },
  "headers": {
    "From": "Acme Billing <billing@acme.com>",
    "To": "ada@example.com",
    "Subject": "Your invoice INV-1042",
    "Message-ID": "<4KDY1iIpQSSW5pAoiz3JEfqcsO0@acme.com>",
    "MIME-Version": "1.0",
    "Content-Type": "multipart/mixed; boundary=\"--_NmP-4f1c2a9e7b3d0e5f-Part_1\""
  },
  "body": {
    "text": "Your invoice is attached.",
    "html": "<p>Your invoice is attached.</p>"
  },
  "attachments": [
    {
      "filename": "INV-1042.pdf",
      "content_type": "application/pdf",
      "size": 40960,
      "content_id": null,
      "content_disposition": "attachment",
      "content": "JVBERi0xLjQKJcOkw7zDqc..."
    }
  ]
}
```

**200 Inbound**

```json
{
  "object": "email",
  "id": "em_4KbeG9poqTmjvQZeN8pMoJkCVNd",
  "type": "inbound",
  "token": "4KTnDU5PzzqDqp8UWb9qVhPVFOT",
  "message_id": "<CAH7x2k9@mail.example.com>",
  "from": "Ada Lovelace <ada@example.com>",
  "to": "support@inbound.acme.com",
  "subject": "Re: Your invoice INV-1042",
  "status": "received",
  "size": 8234,
  "scheduled_at": null,
  "created_at": "2026-10-01T11:02:45.031877Z",
  "updated_at": "2026-10-01T11:02:45.031877Z",
  "meta": null,
  "headers": {
    "From": "Ada Lovelace <ada@example.com>",
    "To": "support@inbound.acme.com",
    "Subject": "Re: Your invoice INV-1042",
    "Content-Type": "text/plain; charset=utf-8"
  },
  "body": {
    "text": "Thanks, received.",
    "html": null
  },
  "attachments": []
}
```

**404**

```json
{
  "error": "Email not found",
  "message": "Email with ID 'em_4KYof1ZzXndZE2VPi0DgULiekG8' not found in your workspace"
}
```

---
Source: https://emailit.com/docs/api-reference/emails/get/

## Retrieve raw MIME — GET /emails/{id}/raw

> Retrieve the complete raw MIME source of an email, with its headers, together with the email's status and metadata.

# Retrieve raw MIME

Retrieves the full MIME source of an email as stored by Emailit, along with its metadata.

`GET /emails/{id}/raw`

Requires a `full` API key. Use it to archive a message, debug its structure or parse it with your own MIME library. Once the content [retention period](/docs/data-retention/) ends, `raw` and `headers` are `null`.

## Path parameters

- `id` (string, required): The email ID.

## Returns

Returns the email's metadata, as in [Retrieve metadata](/docs/api-reference/emails/meta/) but without `attachments`, plus the raw message.

- `raw` (string | null): The full MIME message: the headers, a blank line and the body. `null` once the content is purged.

- `headers` (object | null): The top-level headers as name–value pairs.

The other fields (`object`, `id`, `type`, `token`, `message_id`, `from`, `to`, `subject`, `status`, `size`, `scheduled_at`, `created_at`, `updated_at`, `tracking` and `meta`) are the same as in [Retrieve an email](/docs/api-reference/emails/get/).

**Request** `GET /emails/{id}/raw`

**Node.js**

```javascript
const response = await fetch('https://api.emailit.com/v2/emails/em_4KYof1ZzXndZE2VPi0DgULiekG8/raw', {
  headers: { Authorization: 'Bearer your_api_key' },
});
const raw = await response.json();
```

**Python**

```python
import requests

response = requests.get(
  "https://api.emailit.com/v2/emails/em_4KYof1ZzXndZE2VPi0DgULiekG8/raw",
  headers={"Authorization": "Bearer your_api_key"}
)
raw = response.json()
```

**PHP**

```php
$ch = curl_init('https://api.emailit.com/v2/emails/em_4KYof1ZzXndZE2VPi0DgULiekG8/raw');
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer your_api_key',
  ],
]);
$raw = json_decode(curl_exec($ch), true);
curl_close($ch);
```

**Ruby**

```ruby
require "net/http"
require "json"

uri = URI("https://api.emailit.com/v2/emails/em_4KYof1ZzXndZE2VPi0DgULiekG8/raw")
req = Net::HTTP::Get.new(uri)
req["Authorization"] = "Bearer your_api_key"
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
raw = JSON.parse(http.request(req).body)
```

**Go**

```go
import "github.com/emailit/emailit-go/v2"
client := emailit.NewClient("your_api_key")

raw, err := client.Emails.GetRaw("em_4KYof1ZzXndZE2VPi0DgULiekG8")
```

**Rust**

```rust
use emailit::Emailit;

let emailit = Emailit::new("your_api_key");

let raw = emailit.emails.get_raw("em_4KYof1ZzXndZE2VPi0DgULiekG8").await?;
```

**Java**

```java
import java.net.http.*;
import java.net.URI;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
  .uri(URI.create("https://api.emailit.com/v2/emails/em_4KYof1ZzXndZE2VPi0DgULiekG8/raw"))
  .header("Authorization", "Bearer your_api_key")
  .GET()
  .build();
HttpResponse<String> response = client.send(request,
  HttpResponse.BodyHandlers.ofString());
```

**.NET**

```csharp
using Emailit;

var emailit = new EmailitClient("your_api_key");

var raw = emailit.Emails.GetRaw("em_4KYof1ZzXndZE2VPi0DgULiekG8");
```

**Laravel**

```php
use Illuminate\Support\Facades\Http;

$raw = Http::withToken('your_api_key')
  ->get('https://api.emailit.com/v2/emails/em_4KYof1ZzXndZE2VPi0DgULiekG8/raw')
  ->json();
```

**cURL**

```bash
curl https://api.emailit.com/v2/emails/em_4KYof1ZzXndZE2VPi0DgULiekG8/raw \
  -H "Authorization: Bearer $EMAILIT_API_KEY"
```

**200**

```json
{
  "object": "email",
  "id": "em_4KYof1ZzXndZE2VPi0DgULiekG8",
  "type": "outbound",
  "token": "4KDY1iIpQSSW5pAoiz3JEfqcsO0",
  "message_id": "<4KDY1iIpQSSW5pAoiz3JEfqcsO0@acme.com>",
  "from": "Acme <hello@acme.com>",
  "to": "ada@example.com",
  "subject": "Welcome to Acme",
  "status": "delivered",
  "size": 1342,
  "scheduled_at": null,
  "created_at": "2026-10-01T09:30:12.482913Z",
  "updated_at": "2026-10-01T09:30:14.118204Z",
  "tracking": {
    "loads": false,
    "clicks": false
  },
  "meta": null,
  "headers": {
    "From": "Acme <hello@acme.com>",
    "To": "ada@example.com",
    "Subject": "Welcome to Acme",
    "Message-ID": "<4KDY1iIpQSSW5pAoiz3JEfqcsO0@acme.com>",
    "MIME-Version": "1.0",
    "Content-Type": "text/html; charset=utf-8"
  },
  "raw": "From: Acme <hello@acme.com>\r\nTo: ada@example.com\r\nSubject: Welcome to Acme\r\nMessage-ID: <4KDY1iIpQSSW5pAoiz3JEfqcsO0@acme.com>\r\nMIME-Version: 1.0\r\nContent-Type: text/html; charset=utf-8\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\n<h1>Welcome!</h1><p>Thanks for signing up.</p>"
}
```

**404**

```json
{
  "error": "Email not found",
  "message": "Email with ID 'em_4KYof1ZzXndZE2VPi0DgULiekG8' not found in your workspace"
}
```

---
Source: https://emailit.com/docs/api-reference/emails/raw/

## List attachments — GET /emails/{id}/attachments

> List the attachments of an email with their file names, MIME types, sizes, inline content IDs and Base64-encoded content.

# List attachments

Returns the attachments of an email, including their content.

`GET /emails/{id}/attachments`

Requires a `full` API key. Works for outgoing and inbound emails. Inline images (parts with a `Content-ID`) are included. To get the list without the file contents, use [Retrieve metadata](/docs/api-reference/emails/meta/). Once the content [retention period](/docs/data-retention/) ends, the list is empty.

## Path parameters

- `id` (string, required): The email ID.

## Returns

Returns a list object with every attachment. The list isn't paginated.

- `object` (string): Always `list`.

- `data` (object[]): The attachments.

- `data[].filename` (string): The file name.

- `data[].content_type` (string): The MIME type, such as `application/pdf`.

- `data[].size` (integer): Size of the decoded file in bytes.

- `data[].content_id` (string | null): The `Content-ID` of an inline attachment, or `null`.

- `data[].content_disposition` (string | null): `attachment` or `inline`.

- `data[].content` (string): The file, Base64-encoded.

**Request** `GET /emails/{id}/attachments`

**Node.js**

```javascript
const response = await fetch('https://api.emailit.com/v2/emails/em_4KYof1ZzXndZE2VPi0DgULiekG8/attachments', {
  headers: { Authorization: 'Bearer your_api_key' },
});
const attachments = await response.json();
```

**Python**

```python
import requests

response = requests.get(
  "https://api.emailit.com/v2/emails/em_4KYof1ZzXndZE2VPi0DgULiekG8/attachments",
  headers={"Authorization": "Bearer your_api_key"}
)
attachments = response.json()
```

**PHP**

```php
$ch = curl_init('https://api.emailit.com/v2/emails/em_4KYof1ZzXndZE2VPi0DgULiekG8/attachments');
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer your_api_key',
  ],
]);
$attachments = json_decode(curl_exec($ch), true);
curl_close($ch);
```

**Ruby**

```ruby
require "net/http"
require "json"

uri = URI("https://api.emailit.com/v2/emails/em_4KYof1ZzXndZE2VPi0DgULiekG8/attachments")
req = Net::HTTP::Get.new(uri)
req["Authorization"] = "Bearer your_api_key"
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
attachments = JSON.parse(http.request(req).body)
```

**Go**

```go
import "github.com/emailit/emailit-go/v2"
client := emailit.NewClient("your_api_key")

attachments, err := client.Emails.GetAttachments("em_4KYof1ZzXndZE2VPi0DgULiekG8")
```

**Rust**

```rust
use emailit::Emailit;

let emailit = Emailit::new("your_api_key");

let attachments = emailit.emails.get_attachments("em_4KYof1ZzXndZE2VPi0DgULiekG8").await?;
```

**Java**

```java
import java.net.http.*;
import java.net.URI;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
  .uri(URI.create("https://api.emailit.com/v2/emails/em_4KYof1ZzXndZE2VPi0DgULiekG8/attachments"))
  .header("Authorization", "Bearer your_api_key")
  .GET()
  .build();
HttpResponse<String> response = client.send(request,
  HttpResponse.BodyHandlers.ofString());
```

**.NET**

```csharp
using Emailit;

var emailit = new EmailitClient("your_api_key");

var attachments = emailit.Emails.GetAttachments("em_4KYof1ZzXndZE2VPi0DgULiekG8");
```

**Laravel**

```php
use Illuminate\Support\Facades\Http;

$attachments = Http::withToken('your_api_key')
  ->get('https://api.emailit.com/v2/emails/em_4KYof1ZzXndZE2VPi0DgULiekG8/attachments')
  ->json();
```

**cURL**

```bash
curl https://api.emailit.com/v2/emails/em_4KYof1ZzXndZE2VPi0DgULiekG8/attachments \
  -H "Authorization: Bearer $EMAILIT_API_KEY"
```

**200**

```json
{
  "object": "list",
  "data": [
    {
      "filename": "INV-1042.pdf",
      "content_type": "application/pdf",
      "size": 40960,
      "content_id": null,
      "content_disposition": "attachment",
      "content": "JVBERi0xLjQKJcOkw7zDqc..."
    },
    {
      "filename": "logo.png",
      "content_type": "image/png",
      "size": 5120,
      "content_id": "logo",
      "content_disposition": "inline",
      "content": "iVBORw0KGgoAAAANSUhEUgAA..."
    }
  ]
}
```

**404**

```json
{
  "error": "Email not found",
  "message": "Email with ID 'em_4KYof1ZzXndZE2VPi0DgULiekG8' not found in your workspace"
}
```

---
Source: https://emailit.com/docs/api-reference/emails/attachments/

## Retrieve the body — GET /emails/{id}/body

> Retrieve only the parsed HTML and plain-text body of an email, without headers, metadata or attachments.

# Retrieve the body

Returns the HTML and plain-text body of an email, decoded from its MIME parts.

`GET /emails/{id}/body`

Requires a `full` API key. Works for outgoing and inbound emails. For outgoing emails, the body is what was sent, after template and variable rendering. Once the content [retention period](/docs/data-retention/) ends, both fields are `null`.

## Path parameters

- `id` (string, required): The email ID.

## Returns

- `text` (string | null): The plain-text part, or `null` if the email has none.

- `html` (string | null): The HTML part, or `null` if the email has none.

**Request** `GET /emails/{id}/body`

**Node.js**

```javascript
const response = await fetch('https://api.emailit.com/v2/emails/em_4KYof1ZzXndZE2VPi0DgULiekG8/body', {
  headers: { Authorization: 'Bearer your_api_key' },
});
const body = await response.json();
```

**Python**

```python
import requests

response = requests.get(
  "https://api.emailit.com/v2/emails/em_4KYof1ZzXndZE2VPi0DgULiekG8/body",
  headers={"Authorization": "Bearer your_api_key"}
)
body = response.json()
```

**PHP**

```php
$ch = curl_init('https://api.emailit.com/v2/emails/em_4KYof1ZzXndZE2VPi0DgULiekG8/body');
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer your_api_key',
  ],
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);
```

**Ruby**

```ruby
require "net/http"
require "json"

uri = URI("https://api.emailit.com/v2/emails/em_4KYof1ZzXndZE2VPi0DgULiekG8/body")
req = Net::HTTP::Get.new(uri)
req["Authorization"] = "Bearer your_api_key"
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
body = JSON.parse(http.request(req).body)
```

**Go**

```go
import "github.com/emailit/emailit-go/v2"
client := emailit.NewClient("your_api_key")

body, err := client.Emails.GetBody("em_4KYof1ZzXndZE2VPi0DgULiekG8")
```

**Rust**

```rust
use emailit::Emailit;

let emailit = Emailit::new("your_api_key");

let body = emailit.emails.get_body("em_4KYof1ZzXndZE2VPi0DgULiekG8").await?;
```

**Java**

```java
import java.net.http.*;
import java.net.URI;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
  .uri(URI.create("https://api.emailit.com/v2/emails/em_4KYof1ZzXndZE2VPi0DgULiekG8/body"))
  .header("Authorization", "Bearer your_api_key")
  .GET()
  .build();
HttpResponse<String> response = client.send(request,
  HttpResponse.BodyHandlers.ofString());
```

**.NET**

```csharp
using Emailit;

var emailit = new EmailitClient("your_api_key");

var body = emailit.Emails.GetBody("em_4KYof1ZzXndZE2VPi0DgULiekG8");
```

**Laravel**

```php
use Illuminate\Support\Facades\Http;

$body = Http::withToken('your_api_key')
  ->get('https://api.emailit.com/v2/emails/em_4KYof1ZzXndZE2VPi0DgULiekG8/body')
  ->json();
```

**cURL**

```bash
curl https://api.emailit.com/v2/emails/em_4KYof1ZzXndZE2VPi0DgULiekG8/body \
  -H "Authorization: Bearer $EMAILIT_API_KEY"
```

**200**

```json
{
  "text": "Welcome!\n\nThanks for signing up.",
  "html": "<h1>Welcome!</h1><p>Thanks for signing up.</p>"
}
```

**404**

```json
{
  "error": "Email not found",
  "message": "Email with ID 'em_4KYof1ZzXndZE2VPi0DgULiekG8' not found in your workspace"
}
```

---
Source: https://emailit.com/docs/api-reference/emails/body/

## Retrieve metadata — GET /emails/{id}/meta

> Retrieve an email's status, headers, metadata and attachment list without downloading the message body or attachment contents.

# Retrieve metadata

Retrieves an email without its body: status, headers, your `meta` data and the list of attachments without their contents.

`GET /emails/{id}/meta`

Requires a `full` API key. This is the lightest way to read an email's details when you don't need the content.

## Path parameters

- `id` (string, required): The email ID.

## Returns

Returns the same fields as [Retrieve an email](/docs/api-reference/emails/get/), without `body`, and with `attachments` described but not included:

- `attachments` (object[]): Each attachment's `filename`, `content_type`, `size`, `content_id` and `content_disposition`. No `content`.

- `headers` (object | null): The message headers as name–value pairs, or `null` once the content is purged.

- `meta` (object | null): The `meta` you sent with the email.

**Request** `GET /emails/{id}/meta`

**Node.js**

```javascript
const response = await fetch('https://api.emailit.com/v2/emails/em_4KYof1ZzXndZE2VPi0DgULiekG8/meta', {
  headers: { Authorization: 'Bearer your_api_key' },
});
const meta = await response.json();
```

**Python**

```python
import requests

response = requests.get(
  "https://api.emailit.com/v2/emails/em_4KYof1ZzXndZE2VPi0DgULiekG8/meta",
  headers={"Authorization": "Bearer your_api_key"}
)
meta = response.json()
```

**PHP**

```php
$ch = curl_init('https://api.emailit.com/v2/emails/em_4KYof1ZzXndZE2VPi0DgULiekG8/meta');
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer your_api_key',
  ],
]);
$meta = json_decode(curl_exec($ch), true);
curl_close($ch);
```

**Ruby**

```ruby
require "net/http"
require "json"

uri = URI("https://api.emailit.com/v2/emails/em_4KYof1ZzXndZE2VPi0DgULiekG8/meta")
req = Net::HTTP::Get.new(uri)
req["Authorization"] = "Bearer your_api_key"
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
meta = JSON.parse(http.request(req).body)
```

**Go**

```go
import "github.com/emailit/emailit-go/v2"
client := emailit.NewClient("your_api_key")

meta, err := client.Emails.GetMeta("em_4KYof1ZzXndZE2VPi0DgULiekG8")
```

**Rust**

```rust
use emailit::Emailit;

let emailit = Emailit::new("your_api_key");

let meta = emailit.emails.get_meta("em_4KYof1ZzXndZE2VPi0DgULiekG8").await?;
```

**Java**

```java
import java.net.http.*;
import java.net.URI;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
  .uri(URI.create("https://api.emailit.com/v2/emails/em_4KYof1ZzXndZE2VPi0DgULiekG8/meta"))
  .header("Authorization", "Bearer your_api_key")
  .GET()
  .build();
HttpResponse<String> response = client.send(request,
  HttpResponse.BodyHandlers.ofString());
```

**.NET**

```csharp
using Emailit;

var emailit = new EmailitClient("your_api_key");

var meta = emailit.Emails.GetMeta("em_4KYof1ZzXndZE2VPi0DgULiekG8");
```

**Laravel**

```php
use Illuminate\Support\Facades\Http;

$meta = Http::withToken('your_api_key')
  ->get('https://api.emailit.com/v2/emails/em_4KYof1ZzXndZE2VPi0DgULiekG8/meta')
  ->json();
```

**cURL**

```bash
curl https://api.emailit.com/v2/emails/em_4KYof1ZzXndZE2VPi0DgULiekG8/meta \
  -H "Authorization: Bearer $EMAILIT_API_KEY"
```

**200**

```json
{
  "object": "email",
  "id": "em_4KYof1ZzXndZE2VPi0DgULiekG8",
  "type": "outbound",
  "token": "4KDY1iIpQSSW5pAoiz3JEfqcsO0",
  "message_id": "<4KDY1iIpQSSW5pAoiz3JEfqcsO0@acme.com>",
  "from": "Acme Billing <billing@acme.com>",
  "to": "ada@example.com",
  "subject": "Your invoice INV-1042",
  "status": "delivered",
  "size": 48213,
  "scheduled_at": null,
  "created_at": "2026-10-01T09:30:12.482913Z",
  "updated_at": "2026-10-01T09:30:14.118204Z",
  "tracking": {
    "loads": true,
    "clicks": true
  },
  "meta": {
    "invoice_id": "INV-1042"
  },
  "headers": {
    "From": "Acme Billing <billing@acme.com>",
    "To": "ada@example.com",
    "Subject": "Your invoice INV-1042",
    "Message-ID": "<4KDY1iIpQSSW5pAoiz3JEfqcsO0@acme.com>",
    "MIME-Version": "1.0",
    "Content-Type": "multipart/mixed; boundary=\"--_NmP-4f1c2a9e7b3d0e5f-Part_1\""
  },
  "attachments": [
    {
      "filename": "INV-1042.pdf",
      "content_type": "application/pdf",
      "size": 40960,
      "content_id": null,
      "content_disposition": "attachment"
    }
  ]
}
```

**404**

```json
{
  "error": "Email not found",
  "message": "Email with ID 'em_4KYof1ZzXndZE2VPi0DgULiekG8' not found in your workspace"
}
```

---
Source: https://emailit.com/docs/api-reference/emails/meta/

## Update a scheduled email — POST /emails/{id}

> Change the send time of a scheduled email. Works until three minutes before it's due, and the new time must be at least three minutes ahead.

# Update a scheduled email

Moves a scheduled email to a new send time.

`POST /emails/{id}`

Works with `sending` and `full` API keys. You can only reschedule an email whose status is `scheduled` and whose current send time is more than 3 minutes away. Only the send time can change; to change the content, [cancel](/docs/api-reference/emails/cancel/) the email and send a new one.

A scheduled send to several recipients creates one email per recipient. Reschedule each ID from the `ids` map of the [send response](/docs/api-reference/emails/send/).

## Path parameters

- `id` (string, required): The ID of the scheduled email.

## Body parameters

- `scheduled_at` (string, required): The new send time, as an ISO 8601 date-time such as `2026-10-03T09:00:00Z` or in English such as `tomorrow at 3pm`. It must be more than 3 minutes in the future.

## Returns

- `object` (string): Always `email`.

- `id` (string): The email ID.

- `status` (string): Always `scheduled`.

- `scheduled_at` (string): The new send time.

- `updated_at` (string): When the email was updated.

- `message` (string): A confirmation message.

Returns `422` if the email isn't scheduled, is due within 3 minutes, or the new time can't be parsed or is too soon.

**Request** `POST /emails/{id}`

**Node.js**

```javascript
import { Emailit } from '@emailit/node';
const emailit = new Emailit('your_api_key');

const email = await emailit.emails.update('em_4K76IA5sFNIsLXW9QC2ro8cDbOj', {
  scheduled_at: '2026-10-03T09:00:00Z',
});
```

**Python**

```python
from emailit import EmailitClient
client = EmailitClient("your_api_key")

email = client.emails.update("em_4K76IA5sFNIsLXW9QC2ro8cDbOj", {
  "scheduled_at": "2026-10-03T09:00:00Z"
})
```

**PHP**

```php
$emailit = Emailit::client('your_api_key');

$email = $emailit->emails()->update('em_4K76IA5sFNIsLXW9QC2ro8cDbOj', [
  'scheduled_at' => '2026-10-03T09:00:00Z',
]);
```

**Ruby**

```ruby
require "emailit"
client = Emailit::EmailitClient.new("your_api_key")

email = client.emails.update("em_4K76IA5sFNIsLXW9QC2ro8cDbOj",
  scheduled_at: "2026-10-03T09:00:00Z"
)
```

**Go**

```go
import "github.com/emailit/emailit-go/v2"
client := emailit.NewClient("your_api_key")

email, err := client.Emails.Update("em_4K76IA5sFNIsLXW9QC2ro8cDbOj", &emailit.UpdateEmailRequest{
  ScheduledAt: "2026-10-03T09:00:00Z",
})
```

**Rust**

```rust
use emailit::Emailit;

let emailit = Emailit::new("your_api_key");

let email = emailit.emails.update("em_4K76IA5sFNIsLXW9QC2ro8cDbOj", emailit::types::UpdateEmailParams {
  scheduled_at: "2026-10-03T09:00:00Z".to_string(),
}).await?;
```

**Java**

```java
import com.emailit.*;
import com.emailit.params.*;

EmailitClient emailit = new EmailitClient("your_api_key");

EmailitObject email = emailit.emails().update("em_4K76IA5sFNIsLXW9QC2ro8cDbOj",
  EmailUpdateParams.builder()
    .setScheduledAt("2026-10-03T09:00:00Z")
    .build()
);
```

**.NET**

```csharp
using Emailit;

var emailit = new EmailitClient("your_api_key");

var email = emailit.Emails.Update("em_4K76IA5sFNIsLXW9QC2ro8cDbOj", new EmailUpdateOptions {
  ScheduledAt = "2026-10-03T09:00:00Z",
});
```

**Laravel**

```php
use Emailit\Laravel\Facades\Emailit;

$email = Emailit::emails()->update('em_4K76IA5sFNIsLXW9QC2ro8cDbOj', [
  'scheduled_at' => '2026-10-03T09:00:00Z',
]);
```

**cURL**

```bash
curl -X POST https://api.emailit.com/v2/emails/em_4K76IA5sFNIsLXW9QC2ro8cDbOj \
  -H "Authorization: Bearer $EMAILIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"scheduled_at": "2026-10-03T09:00:00Z"}'
```

**cURL**

```bash
curl -X POST https://api.emailit.com/v2/emails/em_4K76IA5sFNIsLXW9QC2ro8cDbOj \
  -H "Authorization: Bearer $EMAILIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"scheduled_at": "tomorrow at 3pm"}'
```

**200**

```json
{
  "object": "email",
  "id": "em_4K76IA5sFNIsLXW9QC2ro8cDbOj",
  "status": "scheduled",
  "scheduled_at": "2026-10-03T09:00:00.000Z",
  "updated_at": "2026-10-01T10:15:40.207316Z",
  "message": "Email schedule has been updated successfully"
}
```

**404**

```json
{
  "error": "Email not found",
  "message": "Email with ID 'em_4K76IA5sFNIsLXW9QC2ro8cDbOj' not found in your workspace"
}
```

**422 Not scheduled**

```json
{
  "error": "Cannot update email",
  "message": "Email cannot be updated. Current status: 'delivered'. Only 'scheduled' emails can be updated."
}
```

**422 Too late**

```json
{
  "error": "Cannot update email",
  "message": "Scheduled emails can only be updated at least 3 minutes before the scheduled time. This email is scheduled to send in 2 minute(s)."
}
```

**422 Invalid time**

```json
{
  "error": "Invalid scheduled_at",
  "message": "The new scheduled time must be at least 3 minutes in the future."
}
```

---
Source: https://emailit.com/docs/api-reference/emails/update/

## Cancel an email — POST /emails/{id}/cancel

> Cancel a scheduled, accepted or attempted email and remove it from the send queue. Best effort: a delivery already in progress may still complete.

# Cancel an email

Removes an email from the send queue and sets its status to `canceled`.

`POST /emails/{id}/cancel`

Works with `sending` and `full` API keys. Cancel is best effort: it pulls the email out of the queue, but if a delivery attempt has already started, that attempt may still complete and only the remaining retries are stopped. The response tells you which case applies in `in_flight`. Canceling fires an `email.canceled` [event](/docs/webhooks/event-types/), and the credit isn't refunded. The dashboard's **Cancel delivery** action does the same thing.

| Status | Can cancel | Notes |
| --- | --- | --- |
| `scheduled` | Yes | Until 3 minutes before the scheduled time. |
| `accepted` | Yes | Queued and not yet delivered. |
| `attempted` | Yes | Stops the remaining retries after a temporary failure. |
| Any other | No | The email was already delivered, failed, or canceled. |

To cancel a send with several recipients, cancel each ID from the `ids` map of the [send response](/docs/api-reference/emails/send/).

## Path parameters

- `id` (string, required): The email ID.

## Returns

- `object` (string): Always `email`.

- `id` (string): The email ID.

- `status` (string): Always `canceled`.

- `in_flight` (boolean): `true` if a delivery attempt may already be under way and could still complete. `false` if the email was removed from the queue before any attempt.

- `message` (string): A description of the result.

**Request** `POST /emails/{id}/cancel`

**Node.js**

```javascript
import { Emailit } from '@emailit/node';
const emailit = new Emailit('your_api_key');

const email = await emailit.emails.cancel('em_4K76IA5sFNIsLXW9QC2ro8cDbOj');
```

**Python**

```python
from emailit import EmailitClient
client = EmailitClient("your_api_key")

email = client.emails.cancel("em_4K76IA5sFNIsLXW9QC2ro8cDbOj")
```

**PHP**

```php
$emailit = Emailit::client('your_api_key');

$email = $emailit->emails()->cancel('em_4K76IA5sFNIsLXW9QC2ro8cDbOj');
```

**Ruby**

```ruby
require "emailit"
client = Emailit::EmailitClient.new("your_api_key")

email = client.emails.cancel("em_4K76IA5sFNIsLXW9QC2ro8cDbOj")
```

**Go**

```go
import "github.com/emailit/emailit-go/v2"
client := emailit.NewClient("your_api_key")

email, err := client.Emails.Cancel("em_4K76IA5sFNIsLXW9QC2ro8cDbOj")
```

**Rust**

```rust
use emailit::Emailit;

let emailit = Emailit::new("your_api_key");

let email = emailit.emails.cancel("em_4K76IA5sFNIsLXW9QC2ro8cDbOj").await?;
```

**Java**

```java
import com.emailit.*;

EmailitClient emailit = new EmailitClient("your_api_key");

EmailitObject email = emailit.emails().cancel("em_4K76IA5sFNIsLXW9QC2ro8cDbOj");
```

**.NET**

```csharp
using Emailit;

var emailit = new EmailitClient("your_api_key");

var email = emailit.Emails.Cancel("em_4K76IA5sFNIsLXW9QC2ro8cDbOj");
```

**Laravel**

```php
use Emailit\Laravel\Facades\Emailit;

$email = Emailit::emails()->cancel('em_4K76IA5sFNIsLXW9QC2ro8cDbOj');
```

**cURL**

```bash
curl -X POST https://api.emailit.com/v2/emails/em_4K76IA5sFNIsLXW9QC2ro8cDbOj/cancel \
  -H "Authorization: Bearer $EMAILIT_API_KEY"
```

**200**

```json
{
  "object": "email",
  "id": "em_4K76IA5sFNIsLXW9QC2ro8cDbOj",
  "status": "canceled",
  "in_flight": false,
  "message": "Email has been canceled and removed from the send queue."
}
```

**200 In flight**

```json
{
  "object": "email",
  "id": "em_4K76IA5sFNIsLXW9QC2ro8cDbOj",
  "status": "canceled",
  "in_flight": true,
  "message": "Email was canceled. The current delivery attempt may still complete; remaining retries were stopped."
}
```

**404**

```json
{
  "error": "Email not found",
  "message": "Email with ID 'em_4K76IA5sFNIsLXW9QC2ro8cDbOj' not found in your workspace"
}
```

**422 Status**

```json
{
  "error": "Cannot cancel email",
  "message": "Email cannot be canceled. Current status: 'delivered'. Only 'scheduled', 'accepted', or 'attempted' emails can be canceled."
}
```

**422 Too late**

```json
{
  "error": "Cannot cancel email",
  "message": "Scheduled emails can only be canceled at least 3 minutes before the scheduled time. This email is scheduled to send in 2 minute(s)."
}
```

---
Source: https://emailit.com/docs/api-reference/emails/cancel/

## Retry an email — POST /emails/{id}/retry

> Send a bounced, failed, suppressed or held email again as a new email with a new ID. The original stays unchanged.

# Retry an email

Queues a copy of an email that didn't get through. The copy is a new email with its own ID, and the original keeps its status.

`POST /emails/{id}/retry`

Works with `sending` and `full` API keys. The copy has the same sender, recipient, subject, content, headers, `meta` and tracking settings, with a new `Message-ID`. It costs credits like a new send: one credit, or two for a campaign email.

You can retry an email when:

- Its status is `bounced`, `failed`, `suppressed` or `held`.
- It was created in the last 30 days.
- Its content hasn't been purged by your [retention period](/docs/data-retention/), and its sending domain still exists.

Fix the cause first. A suppressed address that's still on your [suppression list](/docs/suppressions/) is suppressed again, and a [held](/docs/logs/email-statuses/) email is held again until the reason it was held is resolved.

## Path parameters

- `id` (string, required): The ID of the email to retry.

## Returns

- `object` (string): Always `email`.

- `id` (string): The ID of the new email.

- `original_id` (string): The ID of the email you retried.

- `token` (string): The new email's internal token.

- `message_id` (string): The new email's `Message-ID`.

- `from` (string): The sender.

- `to` (string): The recipient.

- `subject` (string): The subject.

- `status` (string): Always `accepted`.

- `created_at` (string): When the new email was created.

- `message` (string): A confirmation message.

**Request** `POST /emails/{id}/retry`

**Node.js**

```javascript
import { Emailit } from '@emailit/node';
const emailit = new Emailit('your_api_key');

const email = await emailit.emails.retry('em_4KKrQ7TzsVtzsS8zG069B2aMtoK');
```

**Python**

```python
from emailit import EmailitClient
client = EmailitClient("your_api_key")

email = client.emails.retry("em_4KKrQ7TzsVtzsS8zG069B2aMtoK")
```

**PHP**

```php
$emailit = Emailit::client('your_api_key');

$email = $emailit->emails()->retry('em_4KKrQ7TzsVtzsS8zG069B2aMtoK');
```

**Ruby**

```ruby
require "emailit"
client = Emailit::EmailitClient.new("your_api_key")

email = client.emails.retry("em_4KKrQ7TzsVtzsS8zG069B2aMtoK")
```

**Go**

```go
import "github.com/emailit/emailit-go/v2"
client := emailit.NewClient("your_api_key")

email, err := client.Emails.Retry("em_4KKrQ7TzsVtzsS8zG069B2aMtoK")
```

**Rust**

```rust
use emailit::Emailit;

let emailit = Emailit::new("your_api_key");

let email = emailit.emails.retry("em_4KKrQ7TzsVtzsS8zG069B2aMtoK").await?;
```

**Java**

```java
import com.emailit.*;

EmailitClient emailit = new EmailitClient("your_api_key");

EmailitObject email = emailit.emails().retry("em_4KKrQ7TzsVtzsS8zG069B2aMtoK");
```

**.NET**

```csharp
using Emailit;

var emailit = new EmailitClient("your_api_key");

var email = emailit.Emails.Retry("em_4KKrQ7TzsVtzsS8zG069B2aMtoK");
```

**Laravel**

```php
use Emailit\Laravel\Facades\Emailit;

$email = Emailit::emails()->retry('em_4KKrQ7TzsVtzsS8zG069B2aMtoK');
```

**cURL**

```bash
curl -X POST https://api.emailit.com/v2/emails/em_4KKrQ7TzsVtzsS8zG069B2aMtoK/retry \
  -H "Authorization: Bearer $EMAILIT_API_KEY"
```

**200**

```json
{
  "object": "email",
  "id": "em_4KbeG9poqTmjvQZeN8pMoJkCVNd",
  "original_id": "em_4KKrQ7TzsVtzsS8zG069B2aMtoK",
  "token": "4KTnDU5PzzqDqp8UWb9qVhPVFOT",
  "message_id": "<4KTnDU5PzzqDqp8UWb9qVhPVFOT@acme.com>",
  "from": "Acme <hello@acme.com>",
  "to": "ada@example.com",
  "subject": "Welcome to Acme",
  "status": "accepted",
  "created_at": "2026-10-01T12:04:51.330482Z",
  "message": "Email has been queued for retry"
}
```

**402**

```json
{
  "error": "Insufficient credits",
  "message": "Insufficient credits to retry this email. Required: 1, available: 0."
}
```

**404**

```json
{
  "error": "Email not found",
  "message": "Email with ID 'em_4KKrQ7TzsVtzsS8zG069B2aMtoK' not found in your workspace"
}
```

**422 Status**

```json
{
  "error": "Cannot retry email",
  "message": "Only bounced, failed, suppressed, or held emails can be retried. Current status: 'delivered'"
}
```

**422 Too old**

```json
{
  "error": "Cannot retry email",
  "message": "Emails older than 30 days cannot be retried"
}
```

**422 Purged**

```json
{
  "error": "Cannot retry email",
  "message": "Email raw content has been purged and can no longer be retried"
}
```

---
Source: https://emailit.com/docs/api-reference/emails/retry/

## Forward an email — POST /emails/{id}/forward

> Send an outgoing email again to new recipients, as a plain resend or with a forwarded-message header and an optional note. Limited to 3 per hour.

# Forward an email

Sends the content of an outgoing email to new recipients as a new email. The original email is unchanged.

`POST /emails/{id}/forward`

Works with `sending` and `full` API keys. By default the forward is a plain resend of the original HTML, text and attachments. Set `include_headers` to add a "Forwarded message" block and an optional note above the original content.

A forward is a new send, so the rules of [Send an email](/docs/api-reference/emails/send/) apply: the `from` address must be on a verified sending domain, each recipient costs a credit and counts against the [sending limits](/docs/api-reference/rate-limits/), tracking follows the domain's settings, and the `Idempotency-Key` header is supported. On top of that, a workspace can forward at most 3 emails per hour.

Only outgoing emails can be forwarded, and only while their content is kept by your [retention period](/docs/data-retention/). To forward received mail, use an [automation](/docs/inbound/forward-with-automations/).

## Path parameters

- `id` (string, required): The ID of the outgoing email to forward.

## Headers

- `Idempotency-Key` (string): Makes the forward safe to retry. See [Idempotency](/docs/api-reference/idempotency/).

## Body parameters

- `to` (string | string[], required): The new recipients, as an array or a comma-separated string. Up to 50.

- `include_headers` (boolean): When `true`, adds a "Forwarded message" block with the original sender, date, subject and recipient, and your note above it. When `false`, resends the original content unchanged.

- `comment` (string): A plain-text note to put above the forwarded message. Only used with `include_headers`. `body` is accepted as an alias.

- `html` (string): An HTML note to use instead of the escaped `comment` in the HTML part. Only used with `include_headers`.

- `text` (string): A plain-text note to use instead of `comment` in the text part. Only used with `include_headers`.

- `from` (string): The sender. Defaults to the original email's `from`.

- `subject` (string): The subject. Defaults to the original subject, or `Fwd: ` and the original subject with `include_headers`.

Original attachments are included when their file type is [allowed](/docs/api-reference/emails/send/#attachment-object).

## Returns

Returns the same object as [Send an email](/docs/api-reference/emails/send/), with two extra fields:

- `original_id` (string): The ID of the email you forwarded.

- `message` (string): A confirmation message.

Over the forward limit, the API returns `429` with a `retry-after` header.

**Request** `POST /emails/{id}/forward`

**Node.js**

```javascript
import { Emailit } from '@emailit/node';
const emailit = new Emailit('your_api_key');

const email = await emailit.emails.forward('em_4KYof1ZzXndZE2VPi0DgULiekG8', {
  to: 'grace@example.com',
});
```

**Python**

```python
from emailit import EmailitClient
client = EmailitClient("your_api_key")

email = client.emails.forward("em_4KYof1ZzXndZE2VPi0DgULiekG8", {
  "to": "grace@example.com",
})
```

**PHP**

```php
$emailit = Emailit::client('your_api_key');

$email = $emailit->emails()->forward('em_4KYof1ZzXndZE2VPi0DgULiekG8', [
  'to' => 'grace@example.com',
]);
```

**Ruby**

```ruby
require "emailit"
client = Emailit::EmailitClient.new("your_api_key")

email = client.emails.forward("em_4KYof1ZzXndZE2VPi0DgULiekG8", {
  to: "grace@example.com"
})
```

**Go**

```go
import "github.com/emailit/emailit-go/v2"
client := emailit.NewClient("your_api_key")

email, err := client.Emails.Forward("em_4KYof1ZzXndZE2VPi0DgULiekG8", emailit.ForwardEmailRequest{
  To: "grace@example.com",
})
```

**Rust**

```rust
use emailit::Emailit;

let emailit = Emailit::new("your_api_key");

let email = emailit.emails.forward("em_4KYof1ZzXndZE2VPi0DgULiekG8", ForwardEmail {
    to: "grace@example.com".into(),
    ..Default::default()
}).await?;
```

**Java**

```java
import com.emailit.*;

EmailitClient emailit = new EmailitClient("your_api_key");

EmailitObject email = emailit.emails().forward("em_4KYof1ZzXndZE2VPi0DgULiekG8", Map.of(
  "to", "grace@example.com"
));
```

**.NET**

```csharp
using Emailit;

var emailit = new EmailitClient("your_api_key");

var email = emailit.Emails.Forward("em_4KYof1ZzXndZE2VPi0DgULiekG8", new ForwardEmailRequest {
  To = "grace@example.com"
});
```

**Laravel**

```php
use Emailit\Laravel\Facades\Emailit;

$email = Emailit::emails()->forward('em_4KYof1ZzXndZE2VPi0DgULiekG8', [
  'to' => 'grace@example.com',
]);
```

**cURL**

```bash
curl -X POST https://api.emailit.com/v2/emails/em_4KYof1ZzXndZE2VPi0DgULiekG8/forward \
  -H "Authorization: Bearer $EMAILIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "grace@example.com"
  }'
```

**cURL**

```bash
curl -X POST https://api.emailit.com/v2/emails/em_4KYof1ZzXndZE2VPi0DgULiekG8/forward \
  -H "Authorization: Bearer $EMAILIT_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: fwd-inv-1042-grace" \
  -d '{
    "to": ["grace@example.com"],
    "include_headers": true,
    "comment": "Grace, here is the invoice Ada asked about."
  }'
```

**Node.js**

```javascript
const email = await emailit.emails.forward('em_4KYof1ZzXndZE2VPi0DgULiekG8', {
  to: ['grace@example.com'],
  include_headers: true,
  comment: 'Grace, here is the invoice Ada asked about.',
});
```

**Python**

```python
email = client.emails.forward("em_4KYof1ZzXndZE2VPi0DgULiekG8", {
  "to": ["grace@example.com"],
  "include_headers": True,
  "comment": "Grace, here is the invoice Ada asked about."
})
```

**200**

```json
{
  "object": "email",
  "id": "em_4K76IA5sFNIsLXW9QC2ro8cDbOj",
  "original_id": "em_4KYof1ZzXndZE2VPi0DgULiekG8",
  "token": "4KWzEED2cnej6UMjF4v508VqQIp",
  "message_id": "<4KWzEED2cnej6UMjF4v508VqQIp@acme.com>",
  "from": "Acme Billing <billing@acme.com>",
  "to": ["grace@example.com"],
  "subject": "Fwd: Your invoice INV-1042",
  "status": "accepted",
  "scheduled_at": null,
  "created_at": "2026-10-01T13:20:07.915203Z",
  "tracking": {
    "loads": true,
    "clicks": true
  },
  "message": "Email has been queued for forwarding"
}
```

**400**

```json
{
  "error": "Validation failed",
  "validation_errors": ["Invalid to email address at index 0: grace@example"]
}
```

**404**

```json
{
  "error": "Email not found",
  "message": "Email with ID 'em_4KYof1ZzXndZE2VPi0DgULiekG8' not found in your workspace"
}
```

**422 Inbound**

```json
{
  "error": "Cannot forward email",
  "message": "Only outgoing emails can be forwarded"
}
```

**422 Purged**

```json
{
  "error": "Cannot forward email",
  "message": "Email raw content has been purged and can no longer be forwarded"
}
```

**429**

```json
{
  "error": "too_many_requests",
  "message": "Forwarding is limited to 3 emails per hour for this workspace. Try again later.",
  "limit": 3,
  "current": 4,
  "retry_after": 2711
}
```

---
Source: https://emailit.com/docs/api-reference/emails/forward/

## Retrieve status only — GET /email/{id}

> Retrieve just the current delivery status of an email by ID, without headers, content or metadata, for lightweight status checks.

# Retrieve status only

Returns only the current status of an email.

`GET /email/{id}`

Requires a `full` API key. Note the singular `/email` in the path. The response is small, which makes this endpoint handy for quick status checks. For status changes as they happen, use [webhooks](/docs/webhooks/) instead of polling.

## Path parameters

- `id` (string, required): The email ID.

## Returns

- `status` (string): The current status: `accepted`, `scheduled`, `delivered`, `loaded`, `clicked`, `attempted`, `bounced`, `failed`, `rejected`, `suppressed`, `received`, `complained`, `canceled` or `held`. See [Email statuses](/docs/logs/email-statuses/).

**Request** `GET /email/{id}`

**Node.js**

```javascript
const response = await fetch('https://api.emailit.com/v2/email/em_4KYof1ZzXndZE2VPi0DgULiekG8', {
  headers: { Authorization: 'Bearer your_api_key' },
});
const { status } = await response.json();
```

**Python**

```python
import requests

response = requests.get(
  "https://api.emailit.com/v2/email/em_4KYof1ZzXndZE2VPi0DgULiekG8",
  headers={"Authorization": "Bearer your_api_key"}
)
status = response.json()["status"]
```

**PHP**

```php
$ch = curl_init('https://api.emailit.com/v2/email/em_4KYof1ZzXndZE2VPi0DgULiekG8');
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer your_api_key',
  ],
]);
$status = json_decode(curl_exec($ch), true)['status'];
curl_close($ch);
```

**Ruby**

```ruby
require "net/http"
require "json"

uri = URI("https://api.emailit.com/v2/email/em_4KYof1ZzXndZE2VPi0DgULiekG8")
req = Net::HTTP::Get.new(uri)
req["Authorization"] = "Bearer your_api_key"
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
status = JSON.parse(http.request(req).body)["status"]
```

**Go**

```go
req, _ := http.NewRequest("GET", "https://api.emailit.com/v2/email/em_4KYof1ZzXndZE2VPi0DgULiekG8", nil)
req.Header.Set("Authorization", "Bearer your_api_key")

resp, err := http.DefaultClient.Do(req)
if err != nil {
  return err
}
defer resp.Body.Close()

var result struct {
  Status string `json:"status"`
}
err = json.NewDecoder(resp.Body).Decode(&result)
```

**Rust**

```rust
let response: serde_json::Value = reqwest::Client::new()
    .get("https://api.emailit.com/v2/email/em_4KYof1ZzXndZE2VPi0DgULiekG8")
    .bearer_auth("your_api_key")
    .send()
    .await?
    .json()
    .await?;
let status = response["status"].as_str();
```

**Java**

```java
import java.net.http.*;
import java.net.URI;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
  .uri(URI.create("https://api.emailit.com/v2/email/em_4KYof1ZzXndZE2VPi0DgULiekG8"))
  .header("Authorization", "Bearer your_api_key")
  .GET()
  .build();
HttpResponse<String> response = client.send(request,
  HttpResponse.BodyHandlers.ofString());
```

**.NET**

```csharp
using System.Net.Http.Headers;
using System.Net.Http.Json;

var http = new HttpClient();
http.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "your_api_key");

var result = await http.GetFromJsonAsync<Dictionary<string, string>>(
  "https://api.emailit.com/v2/email/em_4KYof1ZzXndZE2VPi0DgULiekG8");
var status = result["status"];
```

**Laravel**

```php
use Illuminate\Support\Facades\Http;

$status = Http::withToken('your_api_key')
  ->get('https://api.emailit.com/v2/email/em_4KYof1ZzXndZE2VPi0DgULiekG8')
  ->json('status');
```

**cURL**

```bash
curl https://api.emailit.com/v2/email/em_4KYof1ZzXndZE2VPi0DgULiekG8 \
  -H "Authorization: Bearer $EMAILIT_API_KEY"
```

**200**

```json
{
  "status": "delivered"
}
```

**404**

```json
{
  "error": "Email not found",
  "message": "Email with ID 'em_4KYof1ZzXndZE2VPi0DgULiekG8' not found in your workspace"
}
```

---
Source: https://emailit.com/docs/api-reference/emails/status/
