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

# Template Static Elements API

Use this page to add static images to template HTML. Use either an uploaded platform image or a Base64 image.

### Supported image sources

#### Uploaded platform image

Use the `image-uuid:` source format for images uploaded to the platform.

```html
<img width="100" height="50" src="image-uuid:1abd7329-86f1-4f90-81e7-37ea26fcb3a9" hash="aaf24fa42dg42gd42sgd2s2gsd"/>
```

#### Base64 image

Use a Base64 data URI if you want to embed the image directly in the template.

```html
<img width="100" height="50" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAABQCAY=="/>
```

### Rules

* Use `hash` for uploaded platform images.
* Use `src="image-uuid:..."` for platform images.
* Use `src="data:image/...;base64,..."` for Base64 images.
* Do not use external image URLs in template HTML.

{% hint style="info" %}
Use uploaded platform images if you want to reuse the same file across templates. Use Base64 images if you want to keep the image inside one template definition.
{% endhint %}

### How image upload works

1. Upload the image file.
2. Copy `src` and `hash` from the upload response.
3. Insert both values into the `<img>` tag in template HTML.

### Upload image

Use this endpoint to upload an image and get the values for the `<img>` tag.

| Field       | Value                    |
| ----------- | ------------------------ |
| Method      | `POST`                   |
| Request URL | `/api/v1/template/image` |

#### Upload response example

```json
{
  "imageUuid": "1abd7329-86f1-4f90-81e7-37ea26fcb3a9",
  "src": "image-uuid:1abd7329-86f1-4f90-81e7-37ea26fcb3a9",
  "hash": "aaf24fa42dg42gd42sgd2s2gsd"
}
```

Use `src` and `hash` from this response in the template HTML.

### Download image

Use this endpoint to download a previously uploaded image.

<table><thead><tr><th width="374">Field</th><th>Value</th></tr></thead><tbody><tr><td>Method</td><td><code>GET</code></td></tr><tr><td>Request URL</td><td><code>/api/v1/template/{uuid}/image?imageUuid={required}&#x26;envelopeUuid={optional}</code></td></tr></tbody></table>

### Related topics

* [Template Structure API](/api-documentation/template-api/template-structure-api.md)
* [Create Template](/api-documentation/api-methods/create-template.md)
* [PDF Fields in Template](/api-documentation/template-api/pdf-fields-in-template.md)
