Skip to Content
SendlySendly
API ReferenceTemplates

Update a template

PATCH
/api/v1/templates/{id}

Partial update. Omitted fields are left alone.

Changing subject, body, from, from_name or reply_to snapshots the previous content into the template's version history and increments version; changing only name, description or email_category does not, because neither is content a send would have rendered.

A from supplied here is verified before anything is written, on the same terms as create.

Requires the templates:write scope — Create, edit, and delete your email templates.

headerAuthorizationBearer <API Key>

API key authentication. Use a sk_* (FULL) or pk_* (SENDING_ONLY) key as the bearer token. Public keys (pk_*) are restricted to the email-send endpoints and the self-serve list subscribe/unsubscribe pair; every other endpoint — event tracking included — answers 403 for them. In scope terms (used by /api/v1/* operations): FULL keys hold every scope; SENDING_ONLY keys hold only emails:send.

id*string

Resource id.

Formatuuid
application/json
  1. body

Body for PATCH /api/v1/templates/{id}.

name?string
Length1 <= length <= 100
description?|
Lengthlength <= 500
subject?string
Length1 <= length
body?string
Length1 <= length
from?string
Formatemail
from_name?|
Lengthlength <= 100
reply_to?|
Formatemail
email_category?string
Value in"TRANSACTIONAL""MARKETING""SELF_MANAGED_UNSUBSCRIBE"

Response Body

The updated template

application/json
  1. response

An email template as exposed on the v1 API.

id*string
Formatuuid
name*string
description*string|null
subject*string
body*string
from*string
from_name*string|null
reply_to*string|null
email_category*string
Value in"TRANSACTIONAL""MARKETING""SELF_MANAGED_UNSUBSCRIBE"
version*integer
created_at*string
Formatdate-time
updated_at*string
Formatdate-time
Example Request
curl -X PATCH 'https://api.sendly.now/api/v1/templates/497f6eca-6276-4993-bfeb-53cbbbba6f08' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "name": "string",  "description": "string",  "subject": "string",  "body": "string",  "from": "string",  "from_name": "string",  "reply_to": "string",  "email_category": "TRANSACTIONAL",  "version": 0,  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}