# Organization API: Org Email Log

> Every Organization API operation tagged Org Email Log.

Source: https://www.coritan.com/docs/api/reference/organizations/org-email-log/

Base URL: `https://api.coritan.com/api/v1`. Paths below are complete.

To try these requests in the browser, open the [interactive Organization API reference](https://api.coritan.com/docs/org).

## Operations

| Method | Path | Summary |
| --- | --- | --- |
| GET | [`/api/v1/orgs/{org_slug}/email-log`](#op-get-api-v1-orgs-org-slug-email-log) | List email log |
| GET | [`/api/v1/orgs/{org_slug}/email-log/{log_id}`](#op-get-api-v1-orgs-org-slug-email-log-log-id) | Get email log |

### List email log {#op-get-api-v1-orgs-org-slug-email-log}

`GET /api/v1/orgs/{org_slug}/email-log`

Every email the organization sent its customers, newest first:
invoices and receipts, account and password emails, service notices and
the store's order and marketing emails.

Each item has the recipient, the subject, the template (``template_slug``),
whether it was ``sent`` or ``failed``, when, the customer it was for
(``org_customer_id``, or null), which version of the template sent it
(``source``: ``org`` for the organization's own, ``default`` for
Coritan's) and whether the log kept a copy of the message (``has_body``).
Needs Tier 3 support or above.

#### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `org_slug` | path | string | yes |  |
| `q` | query | string or null | no | Finds the recipient's address or the subject. |
| `status` | query | string or null | no | `sent` (the mail server took it) or `failed` (it did not, or the template did not render). |
| `template` | query | string or null | no | Only this template, such as `invoice_created`. |
| `limit` | query | integer | no | At most this many emails, newest first. Default: `50`. |
| `offset` | query | integer | no | Skip this many emails first. Default: `0`. |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Get email log {#op-get-api-v1-orgs-org-slug-email-log-log-id}

`GET /api/v1/orgs/{org_slug}/email-log/{log_id}`

One email as the customer got it: the list's fields, ``html_body``
(the message in the brand's email layout) and ``text_body`` (its plain
text). A link that signs the reader in keeps its address but not its
token, and a gift card's code keeps only its last four characters;
``withheld`` names what was masked. Both bodies are null for an email sent
before the log kept copies. Another organization's email is 404. Needs
Tier 3 support or above.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `log_id` | path | integer | yes |
| `org_slug` | path | string | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |
