---
title: "Get an email template"
method: POST
path: "/email-templates/get"
tags: ["Email Templates"]
---

# Get an email template

`POST /email-templates/get`

## Request

- Base URL: `https://api.reportingninja.com/v1`
- URL: `https://api.reportingninja.com/v1/email-templates/get`
- Auth: HTTP bearer

Returns one email template of the account WITH its body, which /v1/email-templates/list leaves out because it runs to 75.000 characters.

The object this answers is the body /v1/email-templates/update takes: read a template before changing it, because an update is partial and a body written from memory is a body replaced by a summary of itself.

The system template -- the one a delivery uses when it names no template of the account -- is not a template of the account and is not readable here.

## Request body

- EmailTemplatesGetRequest
  - `email_template_key` string, required: The template. From /v1/email-templates/list.

## Response `200`

The call succeeded. This endpoint reports its errors with a real HTTP status, so a 200 always carries status=ok.

- EmailTemplatesGetResponse
  - `status` 'ok', required
  - `data` EmailTemplatesGetData, required
    - `email_template` EmailTemplateWithBody, required: One email template of the account WITH its body, which is what /v1/email-templates/get answers and what the two writes take back. The body is left out of the object when the row carries none.
      - `email_template_key` string, nullable, required: The email template. It is null in ONE place: the preview of a dry run of a creation, where the row does not exist yet and so has no key.
      - `name` string, nullable, required
      - `internal_notes` string, nullable: A note for the account's own staff.
      - `format` 'plain_text' | 'html', nullable, required: Whether the body is HTML or plain text.
      - `sender` string, nullable: The name the email is sent under.
      - `sender_email` string, nullable: The address the email is sent from.
      - `reply_to_email` string, nullable: The address a reply goes to.
      - `subject` string, nullable, required: The subject of the email.
      - `body` string: The body of the email, HTML or plain text according to format. Stored exactly as it was sent: it is not sanitized, because a template is a whole HTML document and the application never paints it.
  - `meta` Meta, required
    - `request_id` string, required: Id of this request, useful when reporting an incident.
    - `timestamp` string, date-time, required: When the answer was built, in UTC.

## Other responses

- `400`: The request was refused before anything was written. INVALID_REQUEST covers the framework refusals of every endpoint (the Content-Type is not application/json, the body could not be read, the body is not valid JSON). The report endpoints add their own: VALIDATION_FAILED with details.problems, UNKNOWN_PARAM with the path of the field the endpoint does not read, and the single-field refusals MISSING_REQUIRED_FIELD, INVALID_VALUE and APPEND_NOT_ALLOWED. The description of each operation lists the ones it emits. Everything else a body can get wrong arrives as an entry of details.problems rather than as the code of the envelope.
- `401`: Invalid or missing Bearer token.
- `404`: A key of the request does not name anything this account owns. NOT_FOUND covers reports, sections, widgets, schedules, portal views, brand templates, email templates and language files; TEMPLATE_NOT_FOUND covers a catalog slug, version or section position that stopped being published between the validation and the write. An entity of another account is reported the same way as one that does not exist.
- `413`: The request body is over 1 MB. The cap is applied before authentication, so this answer is refused without the key being read, and it carries the usual error envelope.
- `429`: A budget was spent. RATE_LIMITED is the per-key read budget (300/minute, 5000/day) or the per-account write budget (60/minute, 1000/day). EMAIL_QUOTA_REACHED is the separate budget of 50 calls per account per day that send email, and its Retry-After points at the next UTC midnight. The Retry-After header gives the seconds until the more restrictive window resets. The X-RateLimit-* headers report the read budget, except on the 429 of a write, where they report the write budget.
- `500`: Internal server error.

---

[API](https://skmtc.dev/reportingninja/apis/reporting-ninja-api.md) · [All operations](https://skmtc.dev/reportingninja/apis/reporting-ninja-api/llms.txt) · [OpenAPI document](https://skmtc.dev/reportingninja/apis/reporting-ninja-api/revisions/13876c71be34?raw)
