> **For coding agents and LLMs:** This is one Social Fetch marketing page (markdown export). For API orientation start with [`/llms.txt`](https://www.socialfetch.dev/llms.txt); for auth and crawl rules use [`/agents.txt`](https://www.socialfetch.dev/agents.txt); for every operation use [`/llms-endpoints.txt`](https://www.socialfetch.dev/llms-endpoints.txt).

## This page

- **On-site (HTML):** <https://www.socialfetch.dev/platforms/discord/templates-code>
- **Markdown (.mdx) URL:** <https://www.socialfetch.dev/platforms/discord/templates-code.mdx>

---

# Discord Template API

A guild template as JSON, including the serialized server layout behind it.

`GET /v1/discord/templates/{code}` returns `data.template` for a public guild template. The record has `code`, `name`, `description`, `usageCount`, `creatorId`, `createdAt`, `updatedAt`, `sourceServerId`, and `serializedSourceServer` with the source server's name, description, region, verification level, notification and content-filter settings, `roles` and `channels`.

Each role carries its `id`, `name`, `permissions`, `color`, `hoist`, `mentionable`, icon and unicode emoji. Each channel carries its `id`, `type`, `name`, `position`, `topic`, `nsfw` and `parentId`. Codes are case-insensitive, and an unknown code returns `lookupStatus: not_found`.

## Request

- **Endpoint:** `GET /v1/discord/templates/{code}`
- **Credits:** 1 credit
Failed requests are free
- **Input:** by template code
- **Full reference:** [docs](https://www.socialfetch.dev/docs/api/v1/discord/templates/code/get)
- **Platform page:** [/platforms/discord](https://www.socialfetch.dev/platforms/discord)

## FAQ

### Where do I find the template code?

It is the last part of a template URL, for example hgM48av5Q69A. Codes are case-insensitive. Pass the code as the path parameter.

### What can I do with the serialized layout?

serializedSourceServer.roles and channels describe the template's structure, including permissions, colours and channel parents. Use them to compare templates or rebuild a server layout.

### Is the creator's user object returned?

No. Only creatorId is returned. The template record and its serialized layout are public, but the creator's user profile is not part of this route.

### How many credits does a template lookup cost?

Pricing is documented on the operation in the API registry (shown on this page). Confirm on every response with meta.creditsCharged: that field is the billing source of truth.
