> ## Documentation Index
> Fetch the complete documentation index at: https://docs.drin.run/llms.txt
> Use this file to discover all available pages before exploring further.

# Retrieve a template

> GET /v1/templates/{id} — fetch one saved template by its id or slug.

Fetch one saved template. The path segment accepts either the template id or its slug.

**`GET /v1/templates/{id}`**

## Path parameters

<ParamField body="id" type="string" required>
  The template `id` (e.g. `tmpl_8XQ2k9`) or its `slug` (e.g. `order-receipt`).
</ParamField>

## Request

<CodeGroup>
  ```bash cURL theme={null}
  curl https://api.drin.run/v1/templates/order-receipt \
    -H "Authorization: Bearer $DRIN_API_KEY"
  ```

  ```typescript Node.js theme={null}
  import { DrinClient } from "@drin00/sdk";

  const drin = new DrinClient({ apiKey: process.env.DRIN_API_KEY });

  // Accepts an id or a slug.
  const template = await drin.templates.get("order-receipt");
  ```
</CodeGroup>

## Response

```json 200 OK theme={null}
{
  "id": "tmpl_8XQ2k9",
  "slug": "order-receipt",
  "name": "Order Receipt",
  "subject": "Receipt {{orderId}}",
  "html": "<p>Hi {{firstName}}, thanks for your order.</p>",
  "text": null,
  "variables": ["firstName", "orderId"],
  "createdAt": "2026-06-02T10:00:00.000Z",
  "updatedAt": "2026-06-02T10:00:00.000Z"
}
```

<Note>
  **Not found.** A template that doesn't exist in your project returns `404 not_found`. Templates are project-scoped — a slug from another project won't resolve here.
</Note>
