Skip to content

Account Templates

This API allows you to store predefined templates at the account level and use them to send messages using the Sending API.

Get account-level templates

Request

Returns a list of account-level templates.

Security
basicAuth
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/v4/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/v4/templates?page=previous&p=template.0&limit=10", "first": "https://api.mailgun.net/v4/templates?limit=10", "next": "https://api.mailgun.net/v4/templates?page=next&p=template.2&limit=10", "last": "https://api.mailgun.net/v4/templates?page=last&limit=10" } }