> For the complete documentation index, see [llms.txt](https://services.markusschmidt.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://services.markusschmidt.pro/mspro.services/endpoints/render-engine/the-basics.md).

# The Basics

Working with the `/templates` endpoint is a **two steps process**:

1. Send your *named* template to the service:

   ```
   POST {{host}}/templates?templateName=Freemarker.HelloWorld
   Body = FreeMarker Template Text
   ```
2. Render your data with reference to the name of the template<br>

   ```
   POST {{host}}/templates/render?templateName=Freemarker.HelloWorld
   { "UserName" : "Markus Schmidt" }
   ```

Templates are persisted. To manage your templates you can use the *Get, Query, Upsert and Delete* functions on the `/template` endpoint (see [OpenAPI Description](https://msproservices.azurewebsites.net/index.html#tag/templates/GET/templates)). Once a template is available (posted) you can use it with as many datasets you want, to `/templates/render` documents.

{% hint style="danger" %}
**Be aware:**

If you use the **SharedAccount** to manage your templates, you are "sharing" your templates with other users on the same (public) account. Everyone can read or modify your templates, or, if someone else uses the same template name, he might "highjack" your template content. It is recommended to add `{company name}.` in front of the name of your template name, for example: <mark style="color:orange;">**`MSPro`**</mark>`.Invoice.EMail`.

Alternatively, you can get a [dedicated account](/mspro.services/endpoints/render-engine/templates/shared-account-templates.md), where your information is no longer shared.
{% endhint %}

{% hint style="info" %}
The rendered documents responded by the `/templates/render` endpoint are not persisted. However, you may want to use the  [Documents](/mspro.services/endpoints/documents.md) endpoint to persist the document in a business context.
{% endhint %}

### Example

```http
POST {{host}}/templates?templateName=Freemarker.HelloWorld
Content-Type: text/plain
Authorization: Basic {{basicToken}}

Hello ${UserName}!
Welcome to the Freemarker render engine.

###

POST {{host}}/templates/render?templateName=Freemarker.HelloWorld
Content-Type: application/json
Accept: text/plain
Authorization: Basic {{basicToken}}

{
    "UserName" : "Lisa Mueller"
}

###

POST {{host}}/templates/render?templateName=Freemarker.HelloWorld
Content-Type: application/json
Accept: text/plain
Authorization: Basic {{basicToken}}

Hello Markus Schmidt!
Welcome to the Freemarker render engine.
```
