Skip to content

Copy a version

Request

Copies an existing version into a new version with the provided name.

Security
basicAuth
Path
domain_namestringrequired

Domain name the template is associated with.

template_namestringrequired

Template name the version is stored under.

version_namestringrequired

Tag of the version to copy.

new_version_namestringrequired

The name for the new version. If the version name already exists, the copy will fail.

Query
commentstring

Comment to be used for the new version.

curl -i -X PUT \
  -u '<username>:<password>' \
  'https://api.mailgun.net/v3/{domain_name}/templates/{template_name}/versions/{version_name}/copy/{new_version_name}?comment=string'

Responses

A 200 response

Bodyapplication/json
messagestringrequired

Response message

versiongithub.com-mailgun-temple-model-Version (object) or nullrequired
Any of:

Created version details

templategithub.com-mailgun-temple-model-Version (object) or nullrequired
Any of:

Deprecated: Use 'version' field

Response
{ "message": "version has been copied", "version": { "tag": "cloned version", "template": "<p>{{firstname}} {{lastname}}</p>", "createdAt": "Fri, 21 Mar 2025 15:00:44 UTC", "comment": "a comment value from copy", "id": "95658c55-e93a-40d5-a02f-a4fadfbbb3ca" } }