Amazon Pinpoint
REST API Reference

Templates

A message template is a set of content and settings that you can define, save, and reuse in email messages, push notifications, SMS text messages, and voice messages for any of your Amazon Pinpoint applications.

When you create a message template, you specify the content and settings that you want to reuse in various components of messages that are based on the template. These components, referred to as template parts, can be the message title or subject, the message body, or both, depending on the message type. A template part can also be a channel-specific setting, such as an image to display or a sound to play when a recipient receives a message that's based on the template. When you send a message that’s based on a template, Amazon Pinpoint populates the message with the content and settings that you defined in the template.

The Templates resource represents the repository of message templates that are associated with your Amazon Pinpoint account. You can use this resource to retrieve information about all the message templates that are associated with your account.

URI

/v1/templates

HTTP Methods

GET

Operation ID: ListTemplates

Retrieves information about all the message templates that are associated with your Amazon Pinpoint account.

Header Parameters

Name Type Required Description
accept String False

Indicates which content types, expressed as MIME types, the client understands.

Query Parameters

Name Type Required Description
page-size String False

The maximum number of items to include in each page of a paginated response. This parameter is currently not supported for application, campaign, and journey metrics.

next-token String False

The string that specifies which page of results to return in a paginated response. This parameter is currently not supported for application, campaign, and journey metrics.

prefix String False

The substring to match in the names of the message templates to include in the results. If you specify this value, Amazon Pinpoint returns only those templates whose names begin with the value that you specify.

template-type String False

The type of message template to include in the results. Valid values are: EMAIL, SMS, PUSH, and VOICE. To include all types of templates in the results, don't include this parameter in your request.

Responses

Status Code Response Model Description
200 TemplatesResponse

The request succeeded.

400 MessageBody

The request contains a syntax error (BadRequestException).

403 MessageBody

The request was denied because access to the specified resource is forbidden (ForbiddenException).

405 MessageBody

The request failed because the method is not allowed for the specified resource (MethodNotAllowedException).

429 MessageBody

The request failed because too many requests were sent during a certain amount of time (TooManyRequestsException).

500 MessageBody

The request failed due to an unknown internal server error, exception, or failure (InternalServerErrorException).

OPTIONS

Retrieves information about the communication requirements and options that are available for the Templates resource.

Responses

Status Code Response Model Description
200 None

The request succeeded.

Schemas

Response Bodies

Example TemplatesResponse

{ "Item": [ { "CreationDate": "string", "LastModifiedDate": "string", "TemplateType": enum, "TemplateName": "string", "TemplateDescription": "string", "DefaultSubstitutions": "string", "tags": { }, "Arn": "string" } ], "NextToken": "string" }

Example MessageBody

{ "RequestID": "string", "Message": "string" }

Properties

MessageBody

Provides information about an API request or response.

Property Type Required Description
RequestID

string

False

The unique identifier for the request or response.

Message

string

False

The message that's returned from the API.

TemplateResponse

Provides information about a message template that's associated with your Amazon Pinpoint account.

Property Type Required Description
CreationDate

string

True

The date when the message template was created.

LastModifiedDate

string

True

The date when the message template was last modified.

TemplateType

string

Values: EMAIL | SMS | VOICE | PUSH

True

The type of channel that the message template is designed for.

TemplateName

string

True

The name of the message template.

TemplateDescription

string

False

The custom description of the message template.

DefaultSubstitutions

string

False

The JSON object that specifies the default values that are used for message variables in the message template. This object is a set of key-value pairs. Each key defines a message variable in the template. The corresponding value defines the default value for that variable.

tags

object

False

A string-to-string map of key-value pairs that identifies the tags that are associated with the message template. Each tag consists of a required tag key and an associated tag value.

Arn

string

False

The Amazon Resource Name (ARN) of the message template.

TemplatesResponse

Provides information about all the message templates that are associated with your Amazon Pinpoint account.

Property Type Required Description
Item

Array of type TemplateResponse

True

An array of responses, one for each message template that's associated with your Amazon Pinpoint account and meets any filter criteria that you specified in the request.

NextToken

string

False

The string to use in a subsequent request to get the next page of results in a paginated response. This value is null if there are no additional pages.

See Also

For more information about using this API in one of the language-specific AWS SDKs and references, see the following:

ListTemplates