# Update a template `PATCH / PUT / POST /api/v1/templates/{id}` Updates a template by ID. ## Permissions Send your API key in `X-API-Key`. Required permissions are **Templates → Write**. ## Path parameters - `id` (integer, required) — ID of the template. ## Body parameters - `name` (string) — Template name, up to 100 characters. - `type` (string) — Use email, sms, or page. - `editor` (string) — Editor format, email or page. - `subject` (string or null) — Email subject, up to 140 characters. - `body_html` (string or null) — HTML content, optionally containing template variables. - `body_json` (map or array or null) — Structured template editor data. - `sms_text` (string or null) — Text used by an SMS template. - `style_css` (string or null) — CSS for a page template. Use null to clear it. - `metadata` (map or null) — Additional template information. Only editable templates can be changed. Use [Set profile print visibility](/api/templates/profile-print-visibility.md) to change menu visibility for a page. ## Request (PATCH) Set ASDINCLOUD_API_KEY and any variables named in the example before running it. ```sh curl --request PATCH \ --url "https://api.asdincloud.com/api/v1/templates/${ID:?Set ID}" \ --header "X-API-Key: $ASDINCLOUD_API_KEY" \ --header "Content-Type: application/json" \ --data '{"subject":"Updated practice schedule"}' ``` ## Request (PUT) Set ASDINCLOUD_API_KEY and any variables named in the example before running it. ```sh curl --request PUT \ --url "https://api.asdincloud.com/api/v1/templates/${ID:?Set ID}" \ --header "X-API-Key: $ASDINCLOUD_API_KEY" \ --header "Content-Type: application/json" \ --data '{"subject":"Updated practice schedule"}' ``` ## Request (POST) Set ASDINCLOUD_API_KEY and any variables named in the example before running it. ```sh curl --request POST \ --url "https://api.asdincloud.com/api/v1/templates/${ID:?Set ID}" \ --header "X-API-Key: $ASDINCLOUD_API_KEY" \ --header "Content-Type: application/json" \ --data '{"subject":"Updated practice schedule"}' ``` ## Response **200 OK** Returns a successful update response. Example with fictional data and selected fields. ```json { "status": "success", "message_key": "entities.template.messages.updated" } ``` ## Errors - `401` — The API key is missing or invalid. - `403` — The API key lacks the required permission. - `404` — The requested record was not found. - `400` — The template, body, or stylesheet could not be processed.