Update a template’s details
PATCH/v1/templates/{id}
Renames a template, files it under a category, or shares traffic across its versions (a split test). split lists 2 to 5 versions with percentages that add up to 100. Sends that name no version then use them: a recipient is always given the same version, so the same person does not see both. Sends that name a version always get that version. Use null to turn it off.
Required scope: templates:manage
Parameters
| Name | In | Description |
|---|---|---|
idrequired | path | The template id. |
Request body
| Field | Type |
|---|---|
nameoptional | string |
categoryoptional | any |
splitoptional | any |
Unknown fields are rejected, so a typo never silently does nothing.
Example
curl -X PATCH 'https://api.sendsend.email/v1/templates/ID' \
-H "Authorization: Bearer $SENDSEND_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"category": "Onboarding",
"split": [
{
"version": 1,
"percent": 50
},
{
"version": 2,
"percent": 50
}
]
}'Response 200
{
"object": "template",
"id": "welcome",
"name": "Welcome",
"category": "Onboarding",
"split": [
{
"version": 1,
"percent": 50
},
{
"version": 2,
"percent": 50
}
]
}Errors
| Status | Code | When |
|---|---|---|
| 400 | validation_error | The request body or parameters are invalid. The message says which field. |
| 404 | not_found | No such resource in this project. |
| 401 | unauthorized | The API key is missing, invalid or revoked. |
| 403 | forbidden | The key does not have the scope this endpoint needs. |
Every error has the same shape. See Errors.