Templates

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).

get/api/templates

Request

  • Base URL
    https://brewpage.app
  • Auth
    none required

Query parameters

q, string

Free text, percent-encoded: a few English words for the page the user wants, e.g. wedding rsvp. At most 200 characters; the first 12 words count. An invalid percent escape answers 400.

Response

Templates and the publish recipe

TemplateCatalogResponse required

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

publish, TemplatePublishRecipe

How to publish a copy of any item

Changes