Skip to content

Create an account-level template version

Request

Adds a new version to an account-level template. If the template doesn't contain any other versions, the first version becomes active. A template can store up to 40 versions.

Security
basicAuth
Path
template_namestringrequired

Template name to create the new version for.

Bodymultipart/form-datarequired
templatestringrequired

Content of the template.

tagstringrequired

Tag of the version that is being created. Must be unique to the template.

commentstring

Comment related to the version that is being created.

activestring

If this flag is set to yes, this version becomes active

headersstring

Key value JSON object of headers to be stored with the template.

curl -i -X POST \
  -u '<username>:<password>' \
  'https://api.mailgun.net/v4/templates/{template_name}/versions' \
  -H 'Content-Type: multipart/form-data' \
  -F template=string \
  -F tag=string \
  -F comment=string \
  -F active=string \
  -F headers=string

Responses

A 200 response

Bodyapplication/json
messagestringrequired

Response message

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

Template details

Response
{ "message": "new version of the template has been stored", "template": { "name": "template_name", "description": "This is the description of the template", "createdAt": "Sat, 12 Nov 1955 06:38:00 UTC", "createdBy": "user-supplied-value", "id": "46565d87-68b6-4edb-8b3c-34554af4bb77", "domain": "header.tld", "version": {} } }