Skip to main content

template_not_found

HTTP 404 · code: "template_not_found" · type: https://docs.formfeed.dev/errors/template-not-found

The workspace of the key has no template with this slug or id, or the template does not have the version the request names. A render names the version with version (which version renders): published (the default), a channel name, latest or a version number. The Templates API answers this code too, for a template or version that does not exist.

Example​

{
"type": "https://docs.formfeed.dev/errors/template-not-found",
"title": "Template not found",
"status": 404,
"detail": "No published template \"invoice\" in workspace production",
"code": "template_not_found",
"request_id": "req_4b7c1e9a2f3d4c5b8a6e7f9012"
}

For a version number or latest the detail reads No version "7" of template "invoice" in workspace production.

Common causes​

  • The template exists but no version of it was ever published, and the request renders published. Saved versions can be rendered by their number, and the newest one as latest with a test key; unsaved edits in the editor are in no version.
  • The key belongs to a different workspace than the template, for example a key from staging against a template in production.
  • A typo in the slug, or an id of another template. A template is named by its slug, its tpl_… id or its UUID.
  • The template was archived. Archived templates do not render; restore it in the app.
  • A version number the template does not have.
  • A Word or PowerPoint template version without its file (Version 3 of template "contract" has no file), for example after a failed upload.

A template that exists but has no channel of the name in version answers channel_not_found instead.

How to fix it​

  • Open the template in the app and check that a version is published, or publish one (formfeed templates push --publish, or POST /v1/templates/{id}/versions/{number}/publish).
  • Run formfeed whoami or call GET /v1/account to see which workspace the key belongs to.
  • List what the key can see with GET /v1/templates.

Retry?​

No. The same request gets the same answer. Fix what the problem names, then send the request again with a new Idempotency-Key or without one: a 4xx answer is stored under its key for 24 hours, so the old key returns this problem again. See retrying.