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

# Get Email

> Get details of a specific email

## Description

Get detailed information and status of a specific email.

## Parameters

<ParamField path="id" type="string" required>
  Unique email ID from send or list response.
</ParamField>

## Response

<ResponseField name="id" type="string">
  Unique email ID.
</ResponseField>

<ResponseField name="status" type="string" enum="['QUEUED', 'SENT', 'DELIVERED', 'BOUNCED', 'FAILED']">
  Current email status.
</ResponseField>

<ResponseField name="created_at" type="string">
  ISO 8601 creation timestamp.
</ResponseField>

<ResponseField name="sent_at" type="string | null">
  Timestamp when sent to server.
</ResponseField>

<ResponseField name="opened_at" type="string | null">
  Timestamp when opened (if tracking enabled).
</ResponseField>

<ResponseField name="clicked_at" type="string | null">
  Timestamp of first click (if tracking enabled).
</ResponseField>

<ResponseField name="to" type="string">
  Recipient email address.
</ResponseField>

<ResponseField name="subject" type="string">
  Email subject.
</ResponseField>

<ResponseField name="from" type="string">
  Sender email address.
</ResponseField>

## Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://api.usesendly.app/v1/emails/email_abc123" \
    -H "Authorization: Bearer se_your_api_key"
  ```

  ```javascript SDK theme={null}
  const email = await client.emails.get('email_abc123')

  console.log(`Status: ${email.status}`)
  console.log(`Sent: ${email.sent_at}`)
  console.log(`Opened: ${email.opened_at ? 'Yes' : 'No'}`)
  ```

  ```javascript SMTP theme={null}
  // Check email status via SDK
  import { Sendly } from '@sendlyapp/sdk'

  const client = new Sendly()
  const email = await client.emails.get('email_abc123')
  ```
</CodeGroup>

### Track Opens

<CodeGroup>
  ```javascript SDK theme={null}
  const email = await client.emails.get('email_abc123')

  if (email.status === 'DELIVERED' && email.opened_at) {
    console.log(`Email opened at: ${email.opened_at}`)
  } else if (email.status === 'DELIVERED') {
    console.log('Email delivered but not opened yet')
  }
  ```

  ```bash cURL theme={null}
  curl "https://api.usesendly.app/v1/emails/email_abc123" \
    -H "Authorization: Bearer se_your_api_key" | jq '.opened_at'
  ```
</CodeGroup>

### Poll for Delivery

<CodeGroup>
  ```javascript SDK theme={null}
  async function waitForDelivery(emailId, maxAttempts = 60) {
    for (let i = 0; i < maxAttempts; i++) {
      const email = await client.emails.get(emailId)
      
      if (email.status === 'DELIVERED') {
        console.log('Email delivered!')
        return email
      } else if (['BOUNCED', 'FAILED'].includes(email.status)) {
        console.error(`Email ${email.status}`)
        return email
      }
      
      await new Promise(r => setTimeout(r, 1000))
    }
    
    throw new Error('Timeout waiting for delivery')
  }
  ```
</CodeGroup>

## Status Meanings

| Status        | Description              |
| ------------- | ------------------------ |
| **QUEUED**    | Waiting to be sent       |
| **SENT**      | Sent to recipient server |
| **DELIVERED** | Successfully delivered   |
| **BOUNCED**   | Rejected as invalid      |
| **FAILED**    | Permanent send error     |

***

Need help? Contact [support@usesendly.app](mailto:support@usesendly.app)
