Skip to content

Get template

Request

Returns metadata information about the stored template specified in the url. If the active flag is provided, the content of the active version of the template is returned. If the version_name flag is provided, version information will be included as well. By default: the version field is not provided. To see available versions other than the active version, use the /versions API instead

Security
basicAuth
Path
domain_namestringrequired

Domain name the template is stored under.

template_namestringrequired

Template name to fetch.

Query
activestring

If this flag is set to yes the active version of the template is included in the response.

curl -i -X GET \
  -u '<username>:<password>' \
  'https://api.mailgun.net/v3/{domain_name}/templates/{template_name}?active=string'

Responses

A 200 response

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

Template details

Response
{ "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": { … } } }