sendsend.email

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

NameInDescription
idrequiredpathThe template id.

Request body

FieldType
nameoptionalstring
categoryoptionalany
splitoptionalany

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

StatusCodeWhen
400validation_errorThe request body or parameters are invalid. The message says which field.
404not_foundNo such resource in this project.
401unauthorizedThe API key is missing, invalid or revoked.
403forbiddenThe key does not have the scope this endpoint needs.

Every error has the same shape. See Errors.