Extract a reusable template from a brief or an article
Derives a template from something you already have and saves it. Requires the write:content scope.
With source_type: "brief" the brief's outline becomes the template sections and the brief's word count, language, country and resolved tone become the field defaults. With source_type: "content" the article's own brief outline is preferred when it has one; otherwise the HTML (or Markdown) headings of the body are parsed into sections with per-section word counts, falling back to a single Main Content section when the body has no headings. Both lookups are organization-scoped and skip soft-deleted rows. Extraction never produces boilerplate blocks — boilerplate_blocks always comes back empty.
This endpoint writes: on success the extracted template is created for your organization (a Template from {topic or title} name unless you pass name), so 201 means a new template exists and data.id is its id. The saved rows are clamped to the content type's allowed word-count range, while the template echoed in the response is the pre-clamp extraction — re-read the template via GET /templates/{id} if you need the stored values.
One special case returns 200 instead of 201: if the source yields no outline sections, nothing is saved and the response carries saved: false plus a message explaining that sections must be added manually.
Request
- Base URL: https://next.frase.io/api/v1
- URL: https://next.frase.io/api/v1/templates/extract
- Auth: API key in header X-API-KEY
Request body
Response
Extracted but NOT saved — the source produced no outline sections
Changes
No recorded changes to this operation across all 1 revision of this API.