Restore an earlier version
POST/v1/templates/{id}/restore
Publishes a copy of an earlier version as the newest. Nothing is lost: the versions in between stay, and sends that name them keep working.
Required scope: templates:manage
Parameters
| Name | In | Description |
|---|---|---|
idrequired | path | The template id. |
Request body
| Field | Type |
|---|---|
versionrequired | integer |
Unknown fields are rejected, so a typo never silently does nothing.
Example
curl -X POST 'https://api.sendsend.email/v1/templates/ID/restore' \
-H "Authorization: Bearer $SENDSEND_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"version": 1
}'Response 201
{
"object": "template",
"id": "welcome",
"version": 3,
"restored_from": 1
}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.