# Get Email by ID API

This API allows you to retrieve metadata about a specific email sent via our API [via its `id`](https://postman-v1.guides.gov.sg/email-api-guide/send-email-api#response-body). The most common use case for this API is to check on the status of an email.

## How It Works

{% hint style="info" %}
To use this API, you must save the `id` field in the response returned when making an API call to send the email. For more information, see [this section](https://postman-v1.guides.gov.sg/email-api-guide/send-email-api#response-json-object).
{% endhint %}

### Get transactional email by ID

{% code title="Get endpoint by email ID" %}

```bash
GET /v1/transactional/email/{emailId}
```

{% endcode %}

{% code title="eg. Request body via email ID" overflow="wrap" %}

```javascript
const response = await fetch('/v1/transactional/email/{emailId}', {
    method: 'GET',
    headers: {
      "Authorization": "Bearer <token>"
    },
});
const data = await response.json();
```

{% endcode %}

{% code title="eg. Response body via email ID" %}

```json
{
  "id": 42,
  "from": "Postman <info@mail.postman.gov.sg>",
  "recipient": "hello@example.com",
  "params": {
    "body": "Hello World",
    "from": "Postman <info@mail.postman.gov.sg>",
    "subject": "Hello World",
    "reply_to": "hello@example.com"
  },
  "attachments_metadata": [
    {
      "fileName": "text",
      "fileSize": 0,
      "hash": "text"
    }
  ],
  "status": "DELIVERED",
  "error_code": null,
  "error_sub_type": null,
  "created_at": "2023-05-10T03:03:54.163Z",
  "updated_at": "2023-05-10T03:05:00.000Z",
  "accepted_at": "2023-05-10T03:03:55.406Z",
  "sent_at": "2023-05-10T03:04:01.912Z",
  "delivered_at": "2023-05-10T03:05:00.000Z",
  "opened_at": null,
  "classification": "FOR_ACTION",
  "tag": "hello world"
}
```

{% endcode %}

**How do I retrieve the email ID?**

Refer to [this section of the guide](https://postman-v1.guides.gov.sg/email-api-guide/send-email-api#id-string) for more information on how to retrieve the email ID.

**What do each of the attributes in the response body mean?**

Refer to [this section of the guide](https://postman-v1.guides.gov.sg/email-api-guide/send-email-api#response-body) for more information on attributes.

## Limitations

We currently do not support pushing webhooks to your server when the status of an email changes. We are exploring the possibility of providing more email analytics, such as monthly reports aggregating statistics about email deliverability grouped based on user-defined tags. For more information, see [this section](https://postman-v1.guides.gov.sg/email-api-guide/programmatic-email-api/send-email-api/email-tagging-and-classification).
