Skip to content
Get Started for Free

Pinpoint

Pinpoint is a customer engagement service to facilitate communication across multiple channels, including email, SMS, and push notifications. Pinpoint allows developers to create and manage customer segments based on various attributes, such as user behavior and demographics, while integrating with other AWS services to send targeted messages to customers.

LocalStack allows you to mock the Pinpoint APIs in your local environment. The supported APIs are available on our API Coverage section, which provides information on the extent of Pinpoint’s integration with LocalStack.

This guide is designed for users new to Pinpoint and assumes basic knowledge of the AWS CLI and our lstk aws command.

Start your LocalStack container using your preferred method. We will demonstrate how to create a Pinpoint application, retrieve all applications, and list tags for the resource.

Create a Pinpoint application using the CreateApp API. Execute the following command:

Terminal window
lstk aws pinpoint create-app \
--create-application-request Name=ExampleCorp,tags={"Stack"="Test"}
Output
{
"ApplicationResponse": {
"Arn": "arn:aws:mobiletargeting:us-east-1:000000000000:apps/4487a55ac6fb4a2699a1b90727c978e7",
"Id": "4487a55ac6fb4a2699a1b90727c978e7",
"Name": "ExampleCorp",
"CreationDate": 1706609789.906863
}
}

You can list all applications using the GetApps API. Execute the following command:

Terminal window
lstk aws pinpoint get-apps
Output
{
"ApplicationsResponse": {
"Item": [
{
"Arn": "arn:aws:mobiletargeting:us-east-1:000000000000:apps/4487a55ac6fb4a2699a1b90727c978e7",
"Id": "4487a55ac6fb4a2699a1b90727c978e7",
"Name": "ExampleCorp",
"CreationDate": 1706609789.906863
}
]
}
}

You can list all tags for the application using the GetApp API. Execute the following command:

Terminal window
lstk aws pinpoint list-tags-for-resource \
--resource-arn arn:aws:mobiletargeting:us-east-1:000000000000:apps/4487a55ac6fb4a2699a1b90727c978e7

Replace the resource-arn with the ARN of the application you created earlier.

Output
{
"TagsModel": {
"tags": {
"Stack": "Test"
}
}
}

The operations SendOTPMessage and VerifyOTPMessage are used for one-time password (OTP) verification.

On production AWS, SendOTPMessage sends an SMS text message with the OTP code. The OTP can then be verified against the reference ID using VerifyOTPMessage

LocalStack however can not send real SMS text messages. Instead it provides alternative ways to retrieve the actual OTP code as illustrated below.

Begin by making a OTP request:

Terminal window
lstk aws pinpoint send-otp-message \
--application-id fff5a801e01643c18a13a763e22a8fbf \
--send-otp-message-request-parameters '{
"BrandName": "LocalStack Pro",
"Channel": "SMS",
"DestinationIdentity": "+1224364860",
"ReferenceId": "liftoffcampaign",
"OriginationIdentity": "+1123581321",
"CodeLength": 6,
"AllowedAttempts": 3,
"ValidityPeriod": 2
}'
Output
{
"MessageResponse": {
"ApplicationId": "fff5a801e01643c18a13a763e22a8fbf"
}
}

You can use the debug endpoint /_aws/pinpoint/<application_id>/<reference_id> to retrieve the OTP message details:

Terminal window
curl http://localhost:4566/_aws/pinpoint/fff5a801e01643c18a13a763e22a8fbf/liftoffcampaign | jq .
Output
{
"AllowedAttempts": 3,
"BrandName": "LocalStack Pro",
"CodeLength": 6,
"DestinationIdentity": "+1224364860",
"OriginationIdentity": "+1123581321",
"ReferenceId": "liftoffcampaign",
"ValidityPeriod": 2,
"Attempts": 0,
"ApplicationId": "fff5a801e01643c18a13a763e22a8fbf",
"CreatedTimestamp": "2024-10-17T05:38:24.070Z",
"Code": "655745"
}

The OTP code is also printed in an INFO level message in the LocalStack log output:

Output
2024-10-17T11:08:24.044 INFO : OTP for application ID fff5a801e01643c18a13a763e22a8fbf reference ID liftoffcampaign: 655745

Finally, the OTP code can be verified using:

Terminal window
lstk aws pinpoint verify-otp-message \
--application-id fff5a801e01643c18a13a763e22a8fbf \
--verify-otp-message-request-parameters '{
"ReferenceId": "liftoffcampaign",
"DestinationIdentity": "+1224364860",
"Otp": "655745"
}'
Output
{
"VerificationResponse": {
"Valid": true
}
}

When validating OTP codes, LocalStack checks for the number of allowed attempts and the validity period. Unlike AWS, there is no lower limit for validity period.

20 of 122 operations implemented

Available from the Ultimate plan. Licensing details

Find an API

Search the full operation list, then sort the table to compare current support.

Loading operations…

Verified on Kubernetes
Loading operations…
Complete static API list All 122 operations and their current support status
OperationStatus
CreateAppImplemented
CreateCampaignNot implemented
CreateEmailTemplateNot implemented
CreateExportJobNot implemented
CreateImportJobNot implemented
CreateInAppTemplateNot implemented
CreateJourneyNot implemented
CreatePushTemplateNot implemented
CreateRecommenderConfigurationNot implemented
CreateSegmentNot implemented
CreateSmsTemplateNot implemented
CreateVoiceTemplateNot implemented
DeleteAdmChannelNot implemented
DeleteApnsChannelNot implemented
DeleteApnsSandboxChannelNot implemented
DeleteApnsVoipChannelNot implemented
DeleteApnsVoipSandboxChannelNot implemented
DeleteAppImplemented
DeleteBaiduChannelNot implemented
DeleteCampaignNot implemented
DeleteEmailChannelNot implemented
DeleteEmailTemplateNot implemented
DeleteEndpointImplemented
DeleteEventStreamImplemented
DeleteGcmChannelNot implemented
DeleteInAppTemplateNot implemented
DeleteJourneyNot implemented
DeletePushTemplateNot implemented
DeleteRecommenderConfigurationNot implemented
DeleteSegmentNot implemented
DeleteSmsChannelImplemented
DeleteSmsTemplateNot implemented
DeleteUserEndpointsNot implemented
DeleteVoiceChannelNot implemented
DeleteVoiceTemplateNot implemented
GetAdmChannelNot implemented
GetApnsChannelNot implemented
GetApnsSandboxChannelNot implemented
GetApnsVoipChannelNot implemented
GetApnsVoipSandboxChannelNot implemented
GetAppImplemented
GetApplicationDateRangeKpiNot implemented
GetApplicationSettingsImplemented
GetAppsImplemented
GetBaiduChannelNot implemented
GetCampaignNot implemented
GetCampaignActivitiesNot implemented
GetCampaignDateRangeKpiNot implemented
GetCampaignVersionNot implemented
GetCampaignVersionsNot implemented
GetCampaignsNot implemented
GetChannelsNot implemented
GetEmailChannelNot implemented
GetEmailTemplateNot implemented
GetEndpointImplemented
GetEventStreamImplemented
GetExportJobNot implemented
GetExportJobsNot implemented
GetGcmChannelNot implemented
GetImportJobNot implemented
GetImportJobsNot implemented
GetInAppMessagesNot implemented
GetInAppTemplateNot implemented
GetJourneyNot implemented
GetJourneyDateRangeKpiNot implemented
GetJourneyExecutionActivityMetricsNot implemented
GetJourneyExecutionMetricsNot implemented
GetJourneyRunExecutionActivityMetricsNot implemented
GetJourneyRunExecutionMetricsNot implemented
GetJourneyRunsNot implemented
GetPushTemplateNot implemented
GetRecommenderConfigurationNot implemented
GetRecommenderConfigurationsNot implemented
GetSegmentNot implemented
GetSegmentExportJobsNot implemented
GetSegmentImportJobsNot implemented
GetSegmentVersionNot implemented
GetSegmentVersionsNot implemented
GetSegmentsNot implemented
GetSmsChannelImplemented
GetSmsTemplateNot implemented
GetUserEndpointsNot implemented
GetVoiceChannelNot implemented
GetVoiceTemplateNot implemented
ListJourneysNot implemented
ListTagsForResourceImplemented
ListTemplateVersionsNot implemented
ListTemplatesNot implemented
PhoneNumberValidateNot implemented
PutEventStreamImplemented
PutEventsNot implemented
RemoveAttributesNot implemented
SendMessagesNot implemented
SendOTPMessageImplemented
SendUsersMessagesNot implemented
TagResourceImplemented
UntagResourceImplemented
UpdateAdmChannelNot implemented
UpdateApnsChannelNot implemented
UpdateApnsSandboxChannelNot implemented
UpdateApnsVoipChannelNot implemented
UpdateApnsVoipSandboxChannelNot implemented
UpdateApplicationSettingsImplemented
UpdateBaiduChannelNot implemented
UpdateCampaignNot implemented
UpdateEmailChannelNot implemented
UpdateEmailTemplateNot implemented
UpdateEndpointImplemented
UpdateEndpointsBatchNot implemented
UpdateGcmChannelNot implemented
UpdateInAppTemplateNot implemented
UpdateJourneyNot implemented
UpdateJourneyStateNot implemented
UpdatePushTemplateNot implemented
UpdateRecommenderConfigurationNot implemented
UpdateSegmentNot implemented
UpdateSmsChannelImplemented
UpdateSmsTemplateNot implemented
UpdateTemplateActiveVersionNot implemented
UpdateVoiceChannelNot implemented
UpdateVoiceTemplateNot implemented
VerifyOTPMessageImplemented
Was this page helpful?