# Get Email by ID API

This API allows you to retrieve metadata about a specific email sent via our API [via its `id`](/email-api-guide/programmatic-email-api/send-email-api.md#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](/email-api-guide/programmatic-email-api/send-email-api.md#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](/email-api-guide/programmatic-email-api/send-email-api.md#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](/email-api-guide/programmatic-email-api/send-email-api.md#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](/email-api-guide/programmatic-email-api/send-email-api/email-tagging-and-classification.md).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://postman-v1.guides.gov.sg/email-api-guide/programmatic-email-api/get-email-by-id-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
