Skip to content

conflict

HTTP 409. You asked to create something that already exists.

409 Conflict
{
"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"
}
}
}

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.

Publish a version instead. details.new_version_url is the exact path:

Terminal window
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.

No. Publish a version, or rename.