---
title: "Get template by ID"
method: GET
path: "/templates/{id}"
tags: ["templates"]
---

# Get template by ID

`GET /templates/{id}`

Returns a single template object

## Path parameters

- `id` integer, required

## Response `200`

OK

- Template
  - `id` integer — The ID of the resource.
  - `created_at` string, date-time — The date and time when the resource was created.
  - `updated_at` string, date-time — The date and time when the resource was last updated.
  - `name` string — The name of the template.
  - `subject_part` string — The subject part.
  - `html_part` string — The HTML content used in the e-mail campaign.
  - `text_part` string — The text content used in the e-mail campaign.

## Other responses

- `401` — Unauthorized
- `404` — Not found
- `default` — Unexpected error

## Changes

- **2021-11-30** `17c65a731b7b` — 1 warning
  - removed the optional property `allOf[#/components/schemas/BaseTemplate]/allOf[subschema #2]/user_id` from the response with the `200` status
- **2021-06-19** `bf7e392ed09b` — 1 info
  - api operation id `getTemplateByID` removed and replaced with `getTemplate`
- **2021-05-29** `54c005b47de3` — 1 info
  - endpoint added
- **2021-05-18** `c686bd33a4a5` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/mailbadger/apis/mailbadger-api/changes/templates/:id/get.md)

---

[API](https://skmtc.dev/mailbadger/apis/mailbadger-api.md) · [All operations](https://skmtc.dev/mailbadger/apis/mailbadger-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/mailbadger/mailbadger-api/revisions/3a7ef49250a1/schema)
