Skip to content

Duplicate a template

Creates a duplicate of an existing template.
The duplicated template will belong to the same user and can be customized independently.
Duplicating a template counts towards the template limit of your plan.

Parameters

id string REQUIRED
The template id of the template that you want to duplicate.

name string OPTIONAL
The name for the duplicated template.
If not provided, defaults to “Copy of {original_template_name}“.

Sample Request

Here’s a sample request to duplicate a template:

ENDPOINT
POST /v1/template/:id/duplicate
REQUEST WITH CUSTOM NAME
fetch(`https://api.templated.io/v1/template/${id}/duplicate?name=My Custom Template`, {
method: 'POST',
headers: {
'Authorization' : `Bearer ${API_KEY}`
}
})
REQUEST WITH DEFAULT NAME
fetch(`https://api.templated.io/v1/template/${id}/duplicate`, {
method: 'POST',
headers: {
'Authorization' : `Bearer ${API_KEY}`
}
})

Response

The API returns a JSON object with the duplicated template details.

{
"id": "new-template-id-123",
"name": "My Custom Template",
"width": 1200,
"height": 800,
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z",
}