2025/07/25 - AWS End User Messaging Social - 8 new3 updated api methods
Changes This release introduces new WhatsApp template management APIs that enable customers to programmatically create and submit templates for approval, monitor approval status, and manage the complete template lifecycle
Creates a new WhatsApp message template from a custom definition.
See also: AWS API Documentation
Request Syntax
client.create_whats_app_message_template( templateDefinition=b'bytes', id='string' )
bytes
[REQUIRED]
The complete template definition as a JSON blob.
string
[REQUIRED]
The ID of the WhatsApp Business Account to associate with this template.
dict
Response Syntax
{ 'metaTemplateId': 'string', 'templateStatus': 'string', 'category': 'string' }
Response Structure
(dict) --
metaTemplateId (string) --
The numeric ID assigned to the template by Meta.
templateStatus (string) --
The status of the created template, such as PENDING or APPROVED..
category (string) --
The category of the template, such as UTILITY or MARKETING.
Deletes a WhatsApp message template.
See also: AWS API Documentation
Request Syntax
client.delete_whats_app_message_template( metaTemplateId='string', deleteAllLanguages=True|False, id='string', templateName='string' )
string
The numeric ID of the template assigned by Meta.
boolean
If true, deletes all language versions of the template.
string
[REQUIRED]
The ID of the WhatsApp Business Account associated with this template.
string
[REQUIRED]
The name of the template to delete.
dict
Response Syntax
{}
Response Structure
(dict) --
Retrieves a specific WhatsApp message template.
See also: AWS API Documentation
Request Syntax
client.get_whats_app_message_template( metaTemplateId='string', id='string' )
string
[REQUIRED]
The numeric ID of the template assigned by Meta.
string
[REQUIRED]
The ID of the WhatsApp Business Account associated with this template.
dict
Response Syntax
{ 'template': 'string' }
Response Structure
(dict) --
template (string) --
The complete template definition as a JSON string (maximum 6000 characters).
Lists WhatsApp message templates for a specific WhatsApp Business Account.
See also: AWS API Documentation
Request Syntax
client.list_whats_app_message_templates( id='string', nextToken='string', maxResults=123 )
string
[REQUIRED]
The ID of the WhatsApp Business Account to list templates for.
string
The token for the next page of results.
integer
The maximum number of results to return per page (1-100).
dict
Response Syntax
{ 'templates': [ { 'templateName': 'string', 'metaTemplateId': 'string', 'templateStatus': 'string', 'templateQualityScore': 'string', 'templateLanguage': 'string', 'templateCategory': 'string' }, ], 'nextToken': 'string' }
Response Structure
(dict) --
templates (list) --
A list of template summaries.
(dict) --
Provides a summary of a WhatsApp message template's key attributes.
templateName (string) --
The name of the template.
metaTemplateId (string) --
The numeric ID assigned to the template by Meta.
templateStatus (string) --
The current status of the template (for example, APPROVED, PENDING, or REJECTED).
templateQualityScore (string) --
The quality score assigned to the template by Meta.
templateLanguage (string) --
The language code of the template (for example, en_US).
templateCategory (string) --
The category of the template (for example, UTILITY or MARKETING).
nextToken (string) --
The token to retrieve the next page of results, if any.
Uploads media for use in a WhatsApp message template.
See also: AWS API Documentation
Request Syntax
client.create_whats_app_message_template_media( id='string', sourceS3File={ 'bucketName': 'string', 'key': 'string' } )
string
[REQUIRED]
The ID of the WhatsApp Business Account associated with this media upload.
dict
Contains information for the S3 bucket that contains media files.
bucketName (string) -- [REQUIRED]
The bucket name.
key (string) -- [REQUIRED]
The object key of the media file.
dict
Response Syntax
{ 'metaHeaderHandle': 'string' }
Response Structure
(dict) --
metaHeaderHandle (string) --
The handle assigned to the uploaded media by Meta, used to reference the media in templates.
Creates a new WhatsApp message template using a template from Meta's template library.
See also: AWS API Documentation
Request Syntax
client.create_whats_app_message_template_from_library( metaLibraryTemplate={ 'templateName': 'string', 'libraryTemplateName': 'string', 'templateCategory': 'string', 'templateLanguage': 'string', 'libraryTemplateButtonInputs': [ { 'type': 'string', 'phoneNumber': 'string', 'url': { 'string': 'string' }, 'otpType': 'string', 'zeroTapTermsAccepted': True|False, 'supportedApps': [ { 'string': 'string' }, ] }, ], 'libraryTemplateBodyInputs': { 'addContactNumber': True|False, 'addLearnMoreLink': True|False, 'addSecurityRecommendation': True|False, 'addTrackPackageLink': True|False, 'codeExpirationMinutes': 123 } }, id='string' )
dict
[REQUIRED]
The template configuration from Meta's library, including customizations for buttons and body text.
templateName (string) -- [REQUIRED]
The name to assign to the template.
libraryTemplateName (string) -- [REQUIRED]
The name of the template in Meta's library.
templateCategory (string) -- [REQUIRED]
The category of the template (for example, UTILITY or MARKETING).
templateLanguage (string) -- [REQUIRED]
The language code for the template (for example, en_US).
libraryTemplateButtonInputs (list) --
Button customizations for the template.
(dict) --
Configuration options for customizing buttons in a template from Meta's library.
type (string) --
The type of button (for example, QUICK_REPLY, CALL, or URL).
phoneNumber (string) --
The phone number in E.164 format for CALL-type buttons.
url (dict) --
The URL with dynamic parameters for URL-type buttons.
(string) --
(string) --
otpType (string) --
The type of one-time password for OTP buttons.
zeroTapTermsAccepted (boolean) --
When true, indicates acceptance of zero-tap terms for the button.
supportedApps (list) --
List of supported applications for this button type.
(dict) --
(string) --
(string) --
libraryTemplateBodyInputs (dict) --
Body text customizations for the template.
addContactNumber (boolean) --
When true, includes a contact number in the template body.
addLearnMoreLink (boolean) --
When true, includes a "learn more" link in the template body.
addSecurityRecommendation (boolean) --
When true, includes security recommendations in the template body.
addTrackPackageLink (boolean) --
When true, includes a package tracking link in the template body.
codeExpirationMinutes (integer) --
The number of minutes until a verification code or OTP expires.
string
[REQUIRED]
The ID of the WhatsApp Business Account to associate with this template.
dict
Response Syntax
{ 'metaTemplateId': 'string', 'templateStatus': 'string', 'category': 'string' }
Response Structure
(dict) --
metaTemplateId (string) --
The numeric ID assigned to the template by Meta.
templateStatus (string) --
The status of the created template (for example, PENDING or APPROVED).
category (string) --
The category of the template (for example, UTILITY or MARKETING).
Updates an existing WhatsApp message template.
See also: AWS API Documentation
Request Syntax
client.update_whats_app_message_template( id='string', metaTemplateId='string', templateCategory='string', templateComponents=b'bytes' )
string
[REQUIRED]
The ID of the WhatsApp Business Account associated with this template.
string
[REQUIRED]
The numeric ID of the template assigned by Meta.
string
The new category for the template (for example, UTILITY or MARKETING).
bytes
The updated components of the template as a JSON blob (maximum 3000 characters).
dict
Response Syntax
{}
Response Structure
(dict) --
Lists templates available in Meta's template library for WhatsApp messaging.
See also: AWS API Documentation
Request Syntax
client.list_whats_app_template_library( nextToken='string', maxResults=123, id='string', filters={ 'string': 'string' } )
string
The token for the next page of results.
integer
The maximum number of results to return per page (1-100).
string
[REQUIRED]
The ID of the WhatsApp Business Account to list library templates for.
dict
Map of filters to apply (searchKey, topic, usecase, industry, language).
(string) --
(string) --
dict
Response Syntax
{ 'metaLibraryTemplates': [ { 'templateName': 'string', 'templateLanguage': 'string', 'templateCategory': 'string', 'templateTopic': 'string', 'templateUseCase': 'string', 'templateIndustry': [ 'string', ], 'templateHeader': 'string', 'templateBody': 'string', 'templateButtons': [ { 'type': 'string', 'text': 'string', 'phoneNumber': 'string', 'url': 'string', 'otpType': 'string', 'zeroTapTermsAccepted': True|False, 'supportedApps': [ { 'string': 'string' }, ] }, ], 'templateId': 'string' }, ], 'nextToken': 'string' }
Response Structure
(dict) --
metaLibraryTemplates (list) --
A list of templates from Meta's library.
(dict) --
Defines the complete structure and content of a template in Meta's library.
templateName (string) --
The name of the template.
templateLanguage (string) --
The language code for the template (for example, en_US).
templateCategory (string) --
The category of the template (for example, UTILITY or MARKETING).
templateTopic (string) --
The topic or subject matter of the template.
templateUseCase (string) --
The intended use case for the template.
templateIndustry (list) --
The industries the template is designed for.
(string) --
templateHeader (string) --
The header text of the template.
templateBody (string) --
The body text of the template.
templateButtons (list) --
The buttons included in the template.
(dict) --
Defines a button in a template from Meta's library.
type (string) --
The type of button (for example, QUICK_REPLY, CALL, or URL).
text (string) --
The text displayed on the button (maximum 40 characters).
phoneNumber (string) --
The phone number in E.164 format for CALL-type buttons.
url (string) --
The URL for URL-type buttons.
otpType (string) --
The type of one-time password for OTP buttons.
zeroTapTermsAccepted (boolean) --
When true, indicates acceptance of zero-tap terms for the button.
supportedApps (list) --
List of supported applications for this button type.
(dict) --
(string) --
(string) --
templateId (string) --
The ID of the template in Meta's library.
nextToken (string) --
The token to retrieve the next page of results, if any.
{'signupCallback': {'callbackUrl': 'string'}}Response
{'signupCallbackResult': {'linkedAccountsWithIncompleteSetup': {'unregisteredWhatsAppPhoneNumbers': {'dataLocalizationRegion': 'string'}}}}
This is only used through the Amazon Web Services console during sign-up to associate your WhatsApp Business Account to your Amazon Web Services account.
See also: AWS API Documentation
Request Syntax
client.associate_whatsapp_business_account( signupCallback={ 'accessToken': 'string', 'callbackUrl': 'string' }, setupFinalization={ 'associateInProgressToken': 'string', 'phoneNumbers': [ { 'id': 'string', 'twoFactorPin': 'string', 'dataLocalizationRegion': 'string', 'tags': [ { 'key': 'string', 'value': 'string' }, ] }, ], 'phoneNumberParent': 'string', 'waba': { 'id': 'string', 'eventDestinations': [ { 'eventDestinationArn': 'string', 'roleArn': 'string' }, ], 'tags': [ { 'key': 'string', 'value': 'string' }, ] } } )
dict
Contains the callback access token.
accessToken (string) -- [REQUIRED]
The access token for your WhatsApp Business Account. The accessToken value is provided by Meta.
callbackUrl (string) --
The URL where WhatsApp will send callback notifications for this account.
dict
A JSON object that contains the phone numbers and WhatsApp Business Account to link to your account.
associateInProgressToken (string) -- [REQUIRED]
An Amazon Web Services access token generated by WhatsAppSignupCallback and used by WhatsAppSetupFinalization.
phoneNumbers (list) -- [REQUIRED]
An array of WabaPhoneNumberSetupFinalization objects containing the details of each phone number associated with the WhatsApp Business Account.
(dict) --
The registration details for a linked phone number.
id (string) -- [REQUIRED]
The unique identifier of the originating phone number associated with the media. Phone number identifiers are formatted as phone-number-id-01234567890123456789012345678901. Use GetLinkedWhatsAppBusinessAccount to find a phone number's id.
twoFactorPin (string) -- [REQUIRED]
The PIN to use for two-step verification. To reset your PIN follow the directions in Updating PIN in the WhatsApp Business Platform Cloud API Reference.
dataLocalizationRegion (string) --
The two letter ISO region for the location of where Meta will store data.
Asia–Pacific (APAC)
Australia AU
Indonesia ID
India IN
Japan JP
Singapore SG
South Korea KR
Europe
Germany DE
Switzerland CH
United Kingdom GB
Latin America (LATAM)
Brazil BR
Middle East and Africa (MEA)
Bahrain BH
South Africa ZA
United Arab Emirates AE
North America (NORAM)
Canada CA
tags (list) --
An array of key and value pair tags.
(dict) --
The tag for a resource.
key (string) -- [REQUIRED]
The tag key.
value (string) --
The tag value.
phoneNumberParent (string) --
Used to add a new phone number to an existing WhatsApp Business Account. This field can't be used when the waba field is present.
waba (dict) --
Used to create a new WhatsApp Business Account and add a phone number. This field can't be used when the phoneNumberParent field is present.
id (string) --
The ID of the linked WhatsApp Business Account, formatted as waba-01234567890123456789012345678901.
eventDestinations (list) --
The event destinations for the linked WhatsApp Business Account.
(dict) --
Contains information on the event destination.
eventDestinationArn (string) -- [REQUIRED]
The ARN of the event destination.
roleArn (string) --
The Amazon Resource Name (ARN) of an Identity and Access Management role that is able to import phone numbers and write events.
tags (list) --
An array of key and value pair tags.
(dict) --
The tag for a resource.
key (string) -- [REQUIRED]
The tag key.
value (string) --
The tag value.
dict
Response Syntax
{ 'signupCallbackResult': { 'associateInProgressToken': 'string', 'linkedAccountsWithIncompleteSetup': { 'string': { 'accountName': 'string', 'registrationStatus': 'COMPLETE'|'INCOMPLETE', 'unregisteredWhatsAppPhoneNumbers': [ { 'arn': 'string', 'phoneNumber': 'string', 'phoneNumberId': 'string', 'metaPhoneNumberId': 'string', 'displayPhoneNumberName': 'string', 'displayPhoneNumber': 'string', 'qualityRating': 'string', 'dataLocalizationRegion': 'string' }, ], 'wabaId': 'string' } } }, 'statusCode': 123 }
Response Structure
(dict) --
signupCallbackResult (dict) --
Contains your WhatsApp registration status.
associateInProgressToken (string) --
An Amazon Web Services access token generated by WhatsAppSignupCallback and used by WhatsAppSetupFinalization.
linkedAccountsWithIncompleteSetup (dict) --
A LinkedWhatsAppBusinessAccountIdMetaData object map containing the details of any WhatsAppBusiness accounts that have incomplete setup.
(string) --
(dict) --
Contains your WhatsApp registration status and details of any unregistered WhatsApp phone number.
accountName (string) --
The name of your account.
registrationStatus (string) --
The registration status of the linked WhatsApp Business Account.
unregisteredWhatsAppPhoneNumbers (list) --
The details for unregistered WhatsApp phone numbers.
(dict) --
The details of your WhatsApp phone number.
arn (string) --
The ARN of the WhatsApp phone number.
phoneNumber (string) --
The phone number for sending WhatsApp.
phoneNumberId (string) --
The phone number ID. Phone number identifiers are formatted as phone-number-id-01234567890123456789012345678901.
metaPhoneNumberId (string) --
The phone number ID from Meta.
displayPhoneNumberName (string) --
The display name for this phone number.
displayPhoneNumber (string) --
The phone number that appears in the recipients display.
qualityRating (string) --
The quality rating of the phone number.
dataLocalizationRegion (string) --
The geographic region where the WhatsApp phone number's data is stored and processed.
wabaId (string) --
The Amazon Resource Name (ARN) of the WhatsApp Business Account ID.
statusCode (integer) --
The status code for the response.
{'account': {'phoneNumbers': {'dataLocalizationRegion': 'string'}}}
Get the details of your linked WhatsApp Business Account.
See also: AWS API Documentation
Request Syntax
client.get_linked_whatsapp_business_account( id='string' )
string
[REQUIRED]
The unique identifier, from Amazon Web Services, of the linked WhatsApp Business Account. WABA identifiers are formatted as waba-01234567890123456789012345678901. Use ListLinkedWhatsAppBusinessAccounts to list all WABAs and their details.
dict
Response Syntax
{ 'account': { 'arn': 'string', 'id': 'string', 'wabaId': 'string', 'registrationStatus': 'COMPLETE'|'INCOMPLETE', 'linkDate': datetime(2015, 1, 1), 'wabaName': 'string', 'eventDestinations': [ { 'eventDestinationArn': 'string', 'roleArn': 'string' }, ], 'phoneNumbers': [ { 'arn': 'string', 'phoneNumber': 'string', 'phoneNumberId': 'string', 'metaPhoneNumberId': 'string', 'displayPhoneNumberName': 'string', 'displayPhoneNumber': 'string', 'qualityRating': 'string', 'dataLocalizationRegion': 'string' }, ] } }
Response Structure
(dict) --
account (dict) --
The details of the linked WhatsApp Business Account.
arn (string) --
The ARN of the linked WhatsApp Business Account.
id (string) --
The ID of the linked WhatsApp Business Account, formatted as waba-01234567890123456789012345678901.
wabaId (string) --
The WhatsApp Business Account ID from meta.
registrationStatus (string) --
The registration status of the linked WhatsApp Business Account.
linkDate (datetime) --
The date the WhatsApp Business Account was linked.
wabaName (string) --
The name of the linked WhatsApp Business Account.
eventDestinations (list) --
The event destinations for the linked WhatsApp Business Account.
(dict) --
Contains information on the event destination.
eventDestinationArn (string) --
The ARN of the event destination.
roleArn (string) --
The Amazon Resource Name (ARN) of an Identity and Access Management role that is able to import phone numbers and write events.
phoneNumbers (list) --
The phone numbers associated with the Linked WhatsApp Business Account.
(dict) --
The details of a linked phone number.
arn (string) --
The full Amazon Resource Name (ARN) for the phone number.
phoneNumber (string) --
The phone number associated with the Linked WhatsApp Business Account.
phoneNumberId (string) --
The phone number ID. Phone number identifiers are formatted as phone-number-id-01234567890123456789012345678901.
metaPhoneNumberId (string) --
The phone number ID from Meta.
displayPhoneNumberName (string) --
The display name for this phone number.
displayPhoneNumber (string) --
The phone number that appears in the recipients display.
qualityRating (string) --
The quality rating of the phone number. This is from Meta.
dataLocalizationRegion (string) --
The geographic region where the WhatsApp phone number's data is stored and processed.
{'phoneNumber': {'dataLocalizationRegion': 'string'}}
Use your WhatsApp phone number id to get the WABA account id and phone number details.
See also: AWS API Documentation
Request Syntax
client.get_linked_whatsapp_business_account_phone_number( id='string' )
string
[REQUIRED]
The unique identifier of the phone number. Phone number identifiers are formatted as phone-number-id-01234567890123456789012345678901. Use GetLinkedWhatsAppBusinessAccount to find a phone number's id.
dict
Response Syntax
{ 'phoneNumber': { 'arn': 'string', 'phoneNumber': 'string', 'phoneNumberId': 'string', 'metaPhoneNumberId': 'string', 'displayPhoneNumberName': 'string', 'displayPhoneNumber': 'string', 'qualityRating': 'string', 'dataLocalizationRegion': 'string' }, 'linkedWhatsAppBusinessAccountId': 'string' }
Response Structure
(dict) --
phoneNumber (dict) --
The details of your WhatsApp phone number.
arn (string) --
The ARN of the WhatsApp phone number.
phoneNumber (string) --
The phone number for sending WhatsApp.
phoneNumberId (string) --
The phone number ID. Phone number identifiers are formatted as phone-number-id-01234567890123456789012345678901.
metaPhoneNumberId (string) --
The phone number ID from Meta.
displayPhoneNumberName (string) --
The display name for this phone number.
displayPhoneNumber (string) --
The phone number that appears in the recipients display.
qualityRating (string) --
The quality rating of the phone number.
dataLocalizationRegion (string) --
The geographic region where the WhatsApp phone number's data is stored and processed.
linkedWhatsAppBusinessAccountId (string) --
The WABA identifier linked to the phone number, formatted as waba-01234567890123456789012345678901.