Skip to content

Share alerts with the team, safely ​

Send alerts to a topic. Everyone who joined the topic in the app gets them on their phone. A single-select choice renders as buttons on the push notification, so acknowledging takes one tap.

bash
export SP_API_TOKEN="your-token"

sp task -t oncall --title "🚨 API latency p99 > 1s" \
  -c "us-east-1 degraded since 14:02;Ack,Escalate,Ignore"
python
from simplepush import Client, ChoiceInput

client = Client(api_token="YOUR_API_TOKEN")

client.send_task(
    topic="oncall",
    title="🚨 API latency p99 > 1s",
    content="us-east-1 degraded since 14:02",
    inputs=[ChoiceInput(options=["Ack", "Escalate", "Ignore"])],
)
ts
import { Client } from '@simplepush/sdk'

const client = new Client({ apiToken: 'YOUR_API_TOKEN' })

await client.sendTask({
  topic: 'oncall',
  title: '🚨 API latency p99 > 1s',
  content: 'us-east-1 degraded since 14:02',
  inputs: [{ type: 'choice', options: ['Ack', 'Escalate', 'Ignore'], required: true }],
})
bash
curl -X POST https://api.simplepu.sh/v1/tasks \
  -H "API-Token: $SP_API_TOKEN" \
  -H "Topic: oncall" \
  -H "Title: 🚨 API latency p99 > 1s" \
  -H "Choice-Input: us-east-1 degraded since 14:02;Ack,Escalate,Ignore"

The topic value is the secret. Anyone who knows it can join and receive. Pick an unguessable value and share it with the team.

Only the bot should send ​

By default every topic holder can also publish. To restrict sending, write-protect the topic in the app under the topic's settings. Everyone still receives, but publishing then requires the sender token that the app issues. Send it in the Topic-Auth-Token header, or in the topicAuthToken field on the JSON endpoints:

bash
curl -X POST https://api.simplepu.sh/v1/tasks \
  -H "API-Token: $SP_API_TOKEN" \
  -H "Topic: oncall" \
  -H "Topic-Auth-Token: $SENDER_TOKEN" \
  -H "Title: 🚨 API latency p99 > 1s" \
  -H "Choice-Input: us-east-1 degraded since 14:02;Ack,Escalate,Ignore"

A publish without a valid token is rejected with 401 write_protection_token_required. See Write-protected topics for details.