---
title: "Find a template"
method: GET
path: "/api/templates"
tags: ["Templates"]
---

# Find a template

`GET /api/templates`

## Request

- Base URL: `https://brewpage.app`
- URL: `https://brewpage.app/api/templates`
- Auth: none required

Lists the official templates that are published now. With `q`, returns the best matches (at most 3, `matched: true`); without `q` or when nothing matches, returns every template with `matched: false`. Each item gives `sourceUrl` (the HTML source as plain text), `demoUrl`, `pageUrl`, `data` (what it saves and who sees it), `useWhen`, `copies` (pages published from it) and the `state` its copy needs. To publish a copy, follow `publish`: change the source as the user asks, POST it to the item's `publishUrl` with the item's `state`, then give the user `link` and `manageUrl` (private).

## Query parameters

- `q` string

## Response `200`

Templates and the publish recipe

- TemplateCatalogResponse: Official BrewPage templates for a request, each with its source and the `state` its copy needs, plus one publish recipe
  - `query` string, nullable: The searched `q`; absent without a non-blank `q`
  - `matched` boolean: true: `items` are the best matches for `q`, at most 3, best first; false: no `q` or no match, `items` lists every template
  - `items` TemplateCatalogItem[]: Templates; empty only while no template is published
    - `slug` string: Template slug
    - `name` string: Template name
    - `purpose` string: What the page does, one sentence
    - `useWhen` string[]: English keywords for requests this template fits
    - `data` string: What the page saves, in which list, and who sees what
    - `sourceUrl` string: The template's HTML source as plain text: start the copy from it
    - `demoUrl` string: Live published example of the template
    - `pageUrl` string: The template's page on BrewPage
    - `publishUrl` string: Create endpoint for a copy of this template (POST, see `publish`)
    - `copies` integer: Pages published as copies of this template
    - `state` object, nullable: The `state` to send with the copy (the JSON of the source's `bp-template-state` block); absent when the page saves nothing
    - `customize` string, nullable: What else changes when the page's options change; absent when nothing does
  - `publish` TemplatePublishRecipe: How to publish a copy of any item
    - `method` 'POST': HTTP method
    - `url` string: Placeholder: the item's `publishUrl`
    - `contentType` 'application/json': Request body type
    - `body` TemplatePublishBody: Request body members; the placeholders name what goes in each
      - `content` string: Placeholder: the item's source, changed as the user asks
      - `format` string: Always `html`
      - `state` string: Placeholder: the item's `state` object
    - `giveUser` string[]: Answer fields to give the user
    - `note` string: Steps and rules for the copy

## Changes

- **2026-11-16** `951bfde74e26`: 2 info
  - added the optional property `items/items/copies` to the response with the `200` status
  - added the optional property `items/items/publishUrl` to the response with the `200` status
- **2026-11-16** `16fb5bee84e9`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/brewpage/apis/brewpage-api/changes/api/templates/get.md)

---

[API](https://skmtc.dev/brewpage/apis/brewpage-api.md) - [All operations](https://skmtc.dev/brewpage/apis/brewpage-api/llms.txt) - [OpenAPI document](https://skmtc.dev/brewpage/apis/brewpage-api/revisions/78d2720a18a9?raw)
