# Template syntax

The Mattermix API uses the [Handlebars](https://handlebarsjs.com/guide/) templating syntax to dynamically update values in HTML or CSS. For example, you could have the following in your HTML: `<p>{{title}}</p>`. The title value could be updated with the API by passing a title value in the `content` object of the request body.&#x20;

Below is an example using the Fetch API from JavaScript:

```javascript
const body = {
  html: "<html><body><p>{{title}}</p></body></html>",
  content: {
    title: "Hello World!"
  }
}

const res = await fetch("mattermix.com/api/v1/image", {
  method: "POST",
  headers: {
      "Content-Type": "application/json",
      Authorization: `Bearer ${process.env.MATTERMIX_API_KEY}`
    },
  body: JSON.stringify(body)
});
```


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mattermix.com/api/template-syntax.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
