KeepSafe Messenger

Documentation Home KeepSafe Messenger Home

Slack Webhooks 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 Slack Webhook

POST /api/slack/register

curl -X POST https://messenger.keepsafe.ai/api/slack/register \
  -H "Authorization: Bearer <API_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"appId":"APP_ID","recipientId":"status-alerts","webhookUrl":"https://hooks.slack.com/services/T000/B000/SECRET","label":"Status alerts"}'
FieldRequiredNotes
appId or bundleIdYesUse the app ID from admin or the bundle/package ID.
recipientIdYesUnique ID for this Slack webhook within the app. Specific Slack sends use this value, not the webhook URL. Aliases: recipientKey or externalId.
webhookUrlYesSlack incoming webhook URL on hooks.slack.com or hooks.slack-gov.com. Stored encrypted; responses and events expose previews only.
labelNoOptional channel, workflow, or recipient label for the admin recipient table.

Send Slack Message

POST /api/slack/send

Specific Recipient IDs

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

Broadcast

curl -X POST https://messenger.keepsafe.ai/api/slack/send \
  -H "Authorization: Bearer <API_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"appId":"APP_ID","target":{"type":"broadcast"},"message":"Hello registered Slack webhooks"}'
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 Slack webhooks for the app. Specific sends use recipient IDs, not webhook URLs.
message, body, or textYesPlain Slack message text.
dryRunNoSet true to record the Slack event without posting to Slack.