Duplicate a template
POST/v1/templates/{id}/duplicate
Copies a version (the latest unless you name one) into a new template, at version 1.
Required scope: templates:manage
Parameters
| Name | In | Description |
|---|---|---|
idrequired | path | The template id. |
Request body
| Field | Type |
|---|---|
idrequired | string |
nameoptional | string |
versionoptional | integer |
Unknown fields are rejected, so a typo never silently does nothing.
Example
curl -X POST 'https://api.sendsend.email/v1/templates/ID/duplicate' \
-H "Authorization: Bearer $SENDSEND_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"id": "welcome-copy"
}'Response 201
{
"object": "template",
"id": "welcome-copy",
"version": 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.