# 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

 - [GET /v4/templates](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/account-templates/get-v4-templates.md): Returns a list of account-level templates.

## Create an account-level template

 - [POST /v4/templates](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/account-templates/post-v4-templates.md): Store a new account-level template that is available across all domains for the account. Include the template name, description and (optionally) the template content. If the template content is provided, a new version is automatically created and becomes the active version.

## Delete all account-level templates

 - [DELETE /v4/templates](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/account-templates/delete-v4-templates.md): Delete all account-level templates and their versions.

## Get all account-level template versions

 - [GET /v4/templates/{template_name}/versions](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/account-templates/get-v4-templates--template-name--versions.md): Returns a paginated list of versions for an account-level template.

## Create an account-level template version

 - [POST /v4/templates/{template_name}/versions](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/account-templates/post-v4-templates--template-name--versions.md): 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.

## Get an account-level template

 - [GET /v4/templates/{template_name}](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/account-templates/get-v4-templates--template-name-.md): Returns metadata information about the stored account-level template. If the active flag is provided, the content of the active version of the template is returned.

## Update an account-level template

 - [PUT /v4/templates/{template_name}](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/account-templates/put-v4-templates--template-name-.md): Update the description of an account-level template.

## Delete an account-level template

 - [DELETE /v4/templates/{template_name}](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/account-templates/delete-v4-templates--template-name-.md): Delete the account-level template specified in the url NOTE: This method deletes all versions of the specified template.

## Get an account-level template version

 - [GET /v4/templates/{template_name}/versions/{version_name}](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/account-templates/get-v4-templates--template-name--versions--version-name-.md): Retrieve the information and content of the specified version of an account-level template.

## Update an account-level template version

 - [PUT /v4/templates/{template_name}/versions/{version_name}](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/account-templates/put-v4-templates--template-name--versions--version-name-.md): Update information or content of the specific version of an account-level template. Existing fields not included in the request will not be changed.

## Delete an account-level template version

 - [DELETE /v4/templates/{template_name}/versions/{version_name}](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/account-templates/delete-v4-templates--template-name--versions--version-name-.md): Delete a specific version of an account-level template.

## Copy a template

 - [PUT /v4/templates/{template_name}/copy](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/account-templates/put-v4-templates--template-name--copy.md): Copies an existing template into new templates with the provided names and account IDs.

## Copy an account-level template version

 - [PUT /v4/templates/{template_name}/versions/{version_name}/copy/{new_version_name}](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/account-templates/put-v4-templates--template-name--versions--version-name--copy--new-version-name-.md): Copies an existing version of an account-level template into a new version with the provided name.

## Rename a template

 - [PUT /v4/templates/{template_name}/rename/{new_template_name}](https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/account-templates/put-v4-templates--template-name--rename--new-template-name-.md): Renames the specified account level template

