conflict
HTTP 409. You asked to create something that already exists.
{ "error": { "type": "conflict", "message": "Template `invoice` already exists. POST a new version instead.", "docs_url": "https://galleyrender.com/docs/errors/conflict", "details": { "code": "template_exists", "template": "invoice", "latest_version": 3, "new_version_url": "/v1/templates/invoice/versions" } }}Why this happens
Section titled “Why this happens”There is exactly one raise site: POST /v1/templates when the
account already has a live template with that name — details.code is template_exists.
Names are lowercased before the check, so Invoice and invoice collide.
The usual cause is treating template creation as an upsert. It is not: creating is a one-time act,
and changing a template is publishing a new version. This is deliberate — versions are immutable,
so anything pinned to invoice@2 keeps rendering exactly as it did.
Trial and new accounts are seeded with the starter library, so invoice, receipt, og-card and
the rest are already taken before you write a line of code.
How to fix it
Section titled “How to fix it”Publish a version instead. details.new_version_url is the exact path:
curl -sS https://api.galleyrender.com/v1/templates/invoice/versions \ -H "Authorization: Bearer $GALLEY_API_KEY" \ -H 'content-type: application/json' \ -d '{"source":"<html>…</html>","schema":{…},"message":"new footer"}'Or pick a different name. See POST /v1/templates/:name/versions.
Does retrying help?
Section titled “Does retrying help?”No. Publish a version, or rename.