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>
| Scope | Purpose |
|---|---|
device:write | Register or update device push tokens, ActivityKit Live Activity push tokens, SMS recipients, and email recipients. |
slack:write | Register or update Slack incoming webhook recipients. |
push:send | Initiate push notifications and Live Activity updates. |
sms:send | Initiate SMS messages through AWS End User Messaging. |
email:send | Initiate email messages through SendGrid. |
slack:send | Initiate Slack messages through registered incoming webhooks. |
admin | Admin-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"}'
| Field | Required | Notes |
|---|---|---|
appId or bundleId | Yes | Use the app ID from admin or the bundle/package ID. |
recipientId | Yes | Unique ID for this Slack webhook within the app. Specific Slack sends use this value, not the webhook URL. Aliases: recipientKey or externalId. |
webhookUrl | Yes | Slack incoming webhook URL on hooks.slack.com or hooks.slack-gov.com. Stored encrypted; responses and events expose previews only. |
label | No | Optional 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"}'
| Field | Required | Notes |
|---|---|---|
appId or bundleId | Yes | Identifies the app that owns the send event. |
recipientId, recipientIds, or target.recipientIds | No | Specific send target. Every ID must already be registered for this app. |
target.type | No | Use broadcast to send to all registered Slack webhooks for the app. Specific sends use recipient IDs, not webhook URLs. |
message, body, or text | Yes | Plain Slack message text. |
dryRun | No | Set true to record the Slack event without posting to Slack. |