KeepSafe Messenger

Documentation Home KeepSafe Messenger Home

SMS Messages API

Base URL: https://messenger.keepsafe.ai

Authentication

App API calls use an app API token generated from the admin setup flow. Send it as a bearer token.

Authorization: Bearer <API_TOKEN>
ScopePurpose
device:writeRegister or update device push tokens, ActivityKit Live Activity push tokens, SMS recipients, and email recipients.
slack:writeRegister or update Slack incoming webhook recipients.
push:sendInitiate push notifications and Live Activity updates.
sms:sendInitiate SMS messages through AWS End User Messaging.
email:sendInitiate email messages through SendGrid.
slack:sendInitiate Slack messages through registered incoming webhooks.
adminAdmin-level API access.

Register SMS Recipient

POST /api/sms/register

curl -X POST https://messenger.keepsafe.ai/api/sms/register \
  -H "Authorization: Bearer <API_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"appId":"APP_ID","recipientId":"user-123","phoneNumber":"512-555-1234","label":"Jon"}'
FieldRequiredNotes
appId or bundleIdYesUse the app ID from admin or the bundle/package ID.
recipientIdYesUnique ID for this SMS recipient within the app. Specific SMS sends use this value, not the phone number. Aliases: recipientKey or externalId.
phoneNumberYesPhone number to register for this app. North American numbers may be sent with punctuation or without +1; stored event history exposes previews only.
labelNoOptional name or device label for the admin recipient table.

Send SMS

POST /api/sms/send

Specific Recipient IDs

curl -X POST https://messenger.keepsafe.ai/api/sms/send \
  -H "Authorization: Bearer <API_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"appId":"APP_ID","recipientIds":["user-123"],"message":"Hello from KeepSafe Messenger","dryRun":true}'

Broadcast

curl -X POST https://messenger.keepsafe.ai/api/sms/send \
  -H "Authorization: Bearer <API_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"appId":"APP_ID","target":{"type":"broadcast"},"message":"Hello registered recipients"}'
FieldRequiredNotes
appId or bundleIdYesIdentifies the app that owns the send event.
recipientId, recipientIds, or target.recipientIdsNoSpecific send target. Every ID must already be registered for this app.
target.typeNoUse broadcast to send to all registered SMS recipients for the app. Specific sends use recipient IDs, not phone numbers.
message or bodyYesSMS body.
messageTypeNoTRANSACTIONAL or PROMOTIONAL. Defaults to TRANSACTIONAL.
dryRunNoSet true to record the SMS event without calling AWS.