Skip to content

Get templates

Request

Returns a list of templates for the domain.

Security
basicAuth
Path
domain_namestringrequired

Domain name to fetch the templates for.

Query
pagestring

Name of the page to retrieve. Value can be first, last, next, or previous. Defaults to first.

Enum ValueDescription
first

Get the first list's page

last

Get the last list's page

next

Get the next list's page

previous

Get the previous list's page

limitinteger

Number of templates to retrieve. Default and max limit is 100.

pstring

Pivot used to retrieve the next page of templates.

curl -i -X GET \
  -u '<username>:<password>' \
  'https://api.mailgun.net/v3/{domain_name}/templates?page=first&limit=0&p=string'

Responses

A 200 response

Bodyapplication/json
itemsArray of objects or null(github.com-mailgun-temple-model-Template)required

List of items

pagingobject(github.com-mailgun-scaffold-httpapi-paging-PagingResponse)required

Pagination details

Response
{ "items": [ {}, {} ], "paging": { "previous": "https://api.mailgun.net/v3/{domain}/templates?page=previous&p=template.0&limit=10", "first": "https://api.mailgun.net/v3/{domain}/templates?limit=10", "next": "https://api.mailgun.net/v3/{domain}/templates?page=next&p=template.2&limit=10", "last": "https://api.mailgun.net/v3/{domain}/templates?page=last&limit=10" } }