---
title: "Create or update a template"
method: POST
path: "/api/templates"
tags: ["Templates"]
---

# Create or update a template

`POST /api/templates`

## Request

- Base URL: `https://api.imagelato.com`
- URL: `https://api.imagelato.com/api/templates`
- Auth: one of:
  - HTTP basic
  - API key in header `Authorization`

Creates a template (or updates one when `_id` is supplied) in your organization. Emits `template.created` or `template.updated`. Requires the `templates:write` scope.

## Request body

- object
  - `name` string, required
  - `projectId` string, required
  - `formats` string[]
  - `sizes` string[]

## Response `200`

The created or updated template

## Other responses

- `401`: Missing or invalid credentials
- `403`: API key is missing the `templates:write` scope
- `429`: API key rate limit exceeded

---

[API](https://skmtc.dev/imagelato/apis/imagelato-api.md) · [All operations](https://skmtc.dev/imagelato/apis/imagelato-api/llms.txt) · [OpenAPI document](https://skmtc.dev/imagelato/apis/imagelato-api/revisions/3e3c7553a1bb?raw)
