# Better Stack on-call change notifications on your phone > Get a push notification when the on-call person changes on a Better Stack on-call calendar. - Company: Better Stack (https://www.justpush.io/recipes/betterstack) - Event: `on_call_change` (On-call change) - Tags: Developer tools, Monitoring - Install: https://studio.justpush.io/recipes/betterstack/on-call-change - Web page: https://www.justpush.io/recipes/betterstack/on-call-change ## Setup 1. Click Install in Studio and sign in. The recipe is added to your account and you get a personal webhook URL. 2. In Better Stack Uptime, go to Integrations > Exporting data > Outgoing webhooks and add one. 3. Paste your webhook URL (shown in Studio after install) as the URL and keep the default template. 4. Choose which On-call change events to send and save. 5. In Better Stack Uptime, go to **Integrations → Exporting data → Outgoing webhooks**, add an **on-call change** webhook with the URL above, and keep the default template. 6. Better Stack doesn't sign webhooks, so keep your endpoint URL private. ## Code Studio calls `handleRequest(request)` with the incoming webhook (`{ method, headers, body, query, raw }`) and sends the message object it returns. Returning `null` sends nothing. ```js // Better Stack → on-call change // Fires when the on-call person changes on a Better Stack on-call calendar, if an // outgoing webhook with the default on-call template is set up. // Docs: https://betterstack.com/docs/uptime/webhooks/ function handleRequest(request) { const data = (request.body || {}).data // Guard: only on-call payloads, which carry a calendar and a list of emails. if (!data || !Array.isArray(data.emails) || !("calendar_name" in data || "calendar_id" in data)) { console.log("Not a Better Stack on-call change — skipping") return null } const who = data.emails.filter((email) => typeof email === "string" && email.trim()) const calendar = typeof data.calendar_name === "string" && data.calendar_name.trim() ? data.calendar_name.trim() : "on-call" return { title: `📟 ${calendar} rotation changed`, message: (typeof data.message === "string" && data.message.trim()) || (who.length ? `Now on call: ${who.join(", ")}` : "Nobody is on call"), topic: "Better Stack", priority: 0, // Normal — worth knowing whether it's you now } } ``` ## Better Stack on_call_change webhook payload (sample) ```json { "data": { "emails": [ "jane@example.com" ], "message": "Jane Doe is now on call for Primary.", "calendar_id": 42, "calendar_name": "Primary", "primary_calendar": true } } ``` ## FAQ ### Does this work on iPhone and Android? Yes. Install the JustPush app from the App Store or Google Play and sign in. Every phone signed in to your account gets the notification. ### Do I need to write code? No. Install the recipe in Studio, paste your webhook URL into Better Stack and you are done. The code is there if you want to change the text, the sound or the buttons. ### Can I change what the notification says? Yes. After install the recipe's code is yours. Edit it in Studio and test it against the sample payload before you save. ### What does it cost? JustPush is free for 30 days. After that it's $19.99 a year, or $39.99 once. There is no extra charge for recipes.