> For the complete documentation index, see [llms.txt](https://docs.flowretail.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flowretail.com/docs/developers/api-documentation/templates/update-transaction-template-by-templateuid.md).

# Update transaction template by templateUid

Update transaction template by templateUid

The text is replaced; the type and the language it was written for are not editable — a text for another language is another template. A name sent names the whole type, every language of it, and a name left out is kept.

The variables used in the body are validated against the variables the type offers, so a template using a variable the type does not have is refused, and a body that does not use a variable the type requires — .serviceNote in SMS\_SERVICE\_ORDER\_UPDATED and EMAIL\_SERVICE\_ORDER\_UPDATED — is refused with a 400 and writes nothing.

On a service template type, a body that is empty or holds nothing but whitespace is refused with a 400 and writes nothing, whichever language it is written in: a text with nothing in it is no text, and a message is never composed from one.

TEMPLATE reaches every template. SERVICE\_CONFIG reaches the templates of a service template type only — a type the platform's own catalog on the `/metadata/templates` endpoint does not list, which is what templateOrigin SERVICE lists, the seven types the service module sends under fixed names and every other type the tenant has created alike — because a service message text is service configuration. A caller holding SERVICE\_CONFIG and not TEMPLATE is refused with a 403 on a template of a platform type, and nothing is written. A tenant-wide ADMIN grant counts as every permission.

Required permissions: TEMPLATE, SERVICE\_CONFIG

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Notifications","description":"Notifications"},{"name":"Templates","description":"Templates"}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"security":[{"authToken":[]},{"accessToken":[]},{"integrationToken":[]}],"components":{"securitySchemes":{"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"accessToken":{"description":"Access token recevied after user login with a deviceToken","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"}},"responses":{"TransactionTemplateResponse":{"description":"TransactionTemplateResponse","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionTemplateResponseSchema"}}}}},"schemas":{"TransactionTemplateResponseSchema":{"title":"TransactionTemplateResponseSchema","description":"A template the tenant has written for one type of message, in one language.\nA tenant holds at most one template per type and language. A template whose language is empty is the language-neutral one for its type, and it is what a template written before languages existed is. Only the platform's own types carry a language-neutral template: a service template type the tenant created always carries a language, and the tenant's own language is the floor version such a type must have.\nWhich text a message is composed from is resolved when it is sent: the template for the language the recipient prefers, otherwise the one for the tenant's own language, otherwise the language-neutral one. The fallback applies at every level, so a tenant that writes one text still reaches every recipient, and a tenant that writes a second only needs it for the recipients who read that language. For a service template type the chain ends at the tenant's own language, because no neutral version exists for it. A text of such a type whose body is empty or holds nothing but whitespace counts as not written, and the chain moves on past it as it does past a missing one.","type":"object","required":["type","name","template","subject","mimeType","templateUid","language","createdAt","createdBy","lastModifiedAt","lastModifiedBy"],"properties":{"type":{"type":"string"},"name":{"type":"string","description":"What the type is called, in words. A platform type carries the platform's name for it, in the signed-in user's language. A service template type the tenant created carries the name the tenant gave it, and its key when it has been given none. Every template of one type carries the same name."},"template":{"type":"string","description":"The template body, read the way the type's channel says: mimeType states which."},"subject":{"type":"string","description":"The template subject, used for emails"},"mimeType":{"$ref":"#/components/schemas/TemplateMimeType"},"templateUid":{"$ref":"#/components/schemas/OptionalUID"},"language":{"description":"The language this text is written in. An empty string on the language-neutral template for its type — the one a recipient falls back to when nothing is written in a language closer to them. Never empty on a service template type, which always carries a language.","type":"string"},"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string"},"lastModifiedAt":{"type":"string","format":"date-time"},"lastModifiedBy":{"type":"string"}}},"TemplateMimeType":{"title":"TemplateMimeType","enum":["HTML","TEXT"],"description":"How the template body is read when the message is composed."},"OptionalUID":{"title":"OptionalUID","type":"string","pattern":"^[A-Za-z0-9-_]*"},"TransactionTemplateUpdateSchema":{"title":"TransactionTemplateUpdateSchema","type":"object","required":["template"],"properties":{"template":{"type":"string"},"subject":{"type":"string"},"name":{"type":"string","maxLength":100,"description":"What staff call a service template type the tenant created, shown in place of its key wherever the type is listed or picked. One name serves the whole type, whichever language a text is written in: a name sent with any of the type's templates names every one of them. Surrounding spaces are trimmed, and the length limit applies to the name as sent. Left out, the type keeps the name it has; a name that is empty once trimmed removes it, and the type is shown by its key again. Two types may carry the same name. Deleting one language of the type keeps the name while another remains; deleting the type's last template removes the name with it. Only a service template type the tenant created takes a name — a platform type is named by the platform, and a name sent for one, an empty one included, is refused with a 400."}}}},"requestBodies":{"TransactionTemplateUpdateRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionTemplateUpdateSchema"}}}}}},"paths":{"/tenants/{tenantUid}/templates/{templateUid}":{"put":{"summary":"Update transaction template by templateUid","tags":["Templates","Notifications"],"responses":{"200":{"$ref":"#/components/responses/TransactionTemplateResponse"}},"operationId":"update-tenant-template-templateUid","description":"Update transaction template by templateUid\n\nThe text is replaced; the type and the language it was written for are not editable — a text for another language is another template. A name sent names the whole type, every language of it, and a name left out is kept.\n\nThe variables used in the body are validated against the variables the type offers, so a template using a variable the type does not have is refused, and a body that does not use a variable the type requires — .serviceNote in SMS_SERVICE_ORDER_UPDATED and EMAIL_SERVICE_ORDER_UPDATED — is refused with a 400 and writes nothing.\n\nOn a service template type, a body that is empty or holds nothing but whitespace is refused with a 400 and writes nothing, whichever language it is written in: a text with nothing in it is no text, and a message is never composed from one.\n\nTEMPLATE reaches every template. SERVICE_CONFIG reaches the templates of a service template type only — a type the platform's own catalog on the `/metadata/templates` endpoint does not list, which is what templateOrigin SERVICE lists, the seven types the service module sends under fixed names and every other type the tenant has created alike — because a service message text is service configuration. A caller holding SERVICE_CONFIG and not TEMPLATE is refused with a 403 on a template of a platform type, and nothing is written. A tenant-wide ADMIN grant counts as every permission.\n\nRequired permissions: TEMPLATE, SERVICE_CONFIG","requestBody":{"$ref":"#/components/requestBodies/TransactionTemplateUpdateRequest"}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.flowretail.com/docs/developers/api-documentation/templates/update-transaction-template-by-templateuid.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
