# Get a template

> Page: https://docs.flung.dev/reference/api/get-v1-templates-id. Index of every page: https://docs.flung.dev/llms.txt

Get a template.

`GET /v1/templates/{id}`

## TL;DR

| Question | Answer |
|---|---|
| What does it do? | Get a template. |
| What does it need? | An API key or an OAuth access token. |
| What does it take? | `id` in the path. |
| What does it return? | Status 200 with a body of type [`Template`](https://docs.flung.dev/reference/api/schemas.md#template). |
| In the SDK? | `flung.templates.get()` |
| What can go wrong? | `401` Missing, unknown, revoked or expired API key; `404` No such template in this workspace; `422` The request failed validation; `429` Too many requests for this credential; wait for `retry-after` seconds. Every failure has the same [error shape](https://docs.flung.dev/reference/api/errors.md). |

## Example

**curl**

```bash
curl -X GET 'https://api.flung.dev/v1/templates/tpl_aaaaaaaaaaaaaaaaaaaaaaaa' \
  --header "Authorization: Bearer $FLUNG_API_KEY"
```

**TypeScript**

```ts
import { Flung } from '@flung.dev/sdk'

const flung = new Flung({ apiKey: process.env.FLUNG_API_KEY! })
const result = await flung.templates.get({
  id: 'tpl_aaaaaaaaaaaaaaaaaaaaaaaa',
})
```

**fetch**

```js
const response = await fetch('https://api.flung.dev/v1/templates/tpl_aaaaaaaaaaaaaaaaaaaaaaaa', {
  method: 'GET',
  headers: {
    'Authorization': `Bearer ${process.env.FLUNG_API_KEY}`,
  },
})
if (!response.ok) throw new Error((await response.json()).error.message)
const result = await response.json()
```

A successful answer looks like this:

```json
{
  "id": "tpl_aaaaaaaaaaaaaaaaaaaaaaaa",
  "name": "string",
  "content": "string",
  "mediaIds": [
    "string"
  ],
  "accountIds": [
    "string"
  ],
  "platformOverrides": {},
  "createdAt": "2026-11-01T09:00:00.000Z",
  "updatedAt": "2026-11-01T09:00:00.000Z"
}
```

## Path parameters

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | `string` | yes |  |

## Responses

| Status | Meaning | Body |
|---|---|---|
| 200 | The template. | [`Template`](https://docs.flung.dev/reference/api/schemas.md#template) |
| 401 | Missing, unknown, revoked or expired API key. | [`Error`](https://docs.flung.dev/reference/api/schemas.md#error) |
| 404 | No such template in this workspace. | [`Error`](https://docs.flung.dev/reference/api/schemas.md#error) |
| 422 | The request failed validation. | [`Error`](https://docs.flung.dev/reference/api/schemas.md#error) |
| 429 | Too many requests for this credential; wait for `retry-after` seconds. | [`Error`](https://docs.flung.dev/reference/api/schemas.md#error) |

## Response body

A 200 answer has the type [`Template`](https://docs.flung.dev/reference/api/schemas.md#template).

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | `string` | yes |  |
| `name` | `string` | yes |  |
| `content` | `string` | yes |  |
| `mediaIds` | `string[]` | yes |  |
| `accountIds` | `string[]` | yes |  |
| `platformOverrides` | `object` | yes |  |
| `platformOverrides.x` | `object` | no |  |
| `platformOverrides.x.content` | `string` | no |  |
| `platformOverrides.x.boardId` | `string` | no |  |
| `platformOverrides.instagram` | `object` | no |  |
| `platformOverrides.instagram.content` | `string` | no |  |
| `platformOverrides.instagram.boardId` | `string` | no |  |
| `platformOverrides.facebook` | `object` | no |  |
| `platformOverrides.facebook.content` | `string` | no |  |
| `platformOverrides.facebook.boardId` | `string` | no |  |
| `platformOverrides.threads` | `object` | no |  |
| `platformOverrides.threads.content` | `string` | no |  |
| `platformOverrides.threads.boardId` | `string` | no |  |
| `platformOverrides.linkedin` | `object` | no |  |
| `platformOverrides.linkedin.content` | `string` | no |  |
| `platformOverrides.linkedin.boardId` | `string` | no |  |
| `platformOverrides.tiktok` | `object` | no |  |
| `platformOverrides.tiktok.content` | `string` | no |  |
| `platformOverrides.tiktok.boardId` | `string` | no |  |
| `platformOverrides.youtube` | `object` | no |  |
| `platformOverrides.youtube.content` | `string` | no |  |
| `platformOverrides.youtube.boardId` | `string` | no |  |
| `platformOverrides.pinterest` | `object` | no |  |
| `platformOverrides.pinterest.content` | `string` | no |  |
| `platformOverrides.pinterest.boardId` | `string` | no |  |
| `platformOverrides.bluesky` | `object` | no |  |
| `platformOverrides.bluesky.content` | `string` | no |  |
| `platformOverrides.bluesky.boardId` | `string` | no |  |
| `platformOverrides.mastodon` | `object` | no |  |
| `platformOverrides.mastodon.content` | `string` | no |  |
| `platformOverrides.mastodon.boardId` | `string` | no |  |
| `platformOverrides.discord` | `object` | no |  |
| `platformOverrides.discord.content` | `string` | no |  |
| `platformOverrides.discord.boardId` | `string` | no |  |
| `platformOverrides.farcaster` | `object` | no |  |
| `platformOverrides.farcaster.content` | `string` | no |  |
| `platformOverrides.farcaster.boardId` | `string` | no |  |
| `createdAt` | `string` | yes |  |
| `updatedAt` | `string` | yes |  |

## See also

| Doc | Why |
|---|---|
| [API reference](https://docs.flung.dev/reference/api.md) | Every endpoint |
| [Schemas](https://docs.flung.dev/reference/api/schemas.md) | Every request and response type |
| [Errors](https://docs.flung.dev/reference/api/errors.md) | Every error code and what to do about it |
