Webhooks


Overview

Once the Emergency Workflow API is triggered, the partner's server and users technically fall into a "black box" in which RapidSOS provided a successful 2XX response indicating the flow has started, but there is no immediate method of knowing how the flow progresses.

Enter Webhooks. RapidSOS provides webhooks so that our partners can:

  1. Develop their own actions and processes based on the updates they receive from us.
    • One example would be push notifications in an app to the user as they are waiting for help.
  2. Create their own reporting for what happens during the course of a flow.

Requirements

  • For a Partner to receive webhooks, they must provide a server for us to send them to
    • Ideally, it should have some sort of authentication.
    • Only public IPs are permitted. Please discuss with your RapidSOS administrator if this will be a challenge.

Webhook Structure

FieldTypeDescriptionNotes
alert_idstringRapidSOS unique ID (parent session)Also seen in response to initial API request to /rem endpoint
eventIdstringPartner's unique ID generated by its own server for the event (exists prior to the RSOS API request)
userIdstringPartner's unique ID for the subscriber triggering the event
verbstringVerb to describe the action taking place
messagestringOpen text comments with description of actions taking place
timestampnumberthe time the event occurredUnix timestamp

A signature header is also provided: x-rapidsos

Sample Webhook

When are webhooks sent?

At a minimum, webhooks are sent at all key decision points in a flow.

  • Confirming receipt of the trigger and to indicate that the flow is starting
  • Confirming that the user has been contacted
  • Confirming the user’s decision to request help, decline, or no answer
  • If help is needed, confirming that the call is being routed to 911
  • Then confirming when the call with 911 ends
  • If monitoring is included, confirming that the monitoring center has been notified
  • If monitoring is included, confirming that the monitoring center has completed the alarm w/ the result (dispatch vs false alarm)
  • When the flow has ended for any reason

List of Webhook Verbs

Note: A partner will only receive the webhooks that are relevant to their solution e.g. if you are not using a Monitoring solution, you will not receive those webhooks

VerbDescription
flow.status.triggerReceivedWorkflow is starting
flow.status.duplicateRequestThere is an existing request for the subscriber
flow.status.callingUserCalling primary user
flow.status.primaryConfirmPrimary user confirmed a request for emergency services
flow.status.primaryCancelPrimary user canceled a request for emergency services
flow.status.primaryInvalidResponsePrimary user provided an invalid safeword or PIN
flow.status.primaryNoResponsePrimary user did not respond to the verification attempt
flow.status.primaryContactSupportPrimary user requested to contact Tech Partner support
flow.status.callingContactCalling an emergency contact
flow.status.contactConfirmEmergency contact confirmed a request for emergency services
flow.status.contactCancelEmergency Contact canceled a request for emergency services
flow.status.primaryContactInvalidResponseEmergency Contact provided an invalid safeword or PIN
flow.status.contactNoResponseEmergency Contact did not respond to the verification attempt
flow.status.noAnswerNo call attempts were answered
flow.status.groupSmsGroup SMS sent
flow.status.initiateSMSSMS sent (2-way with 1 user only
flow.status.agentChatInitiated2-way SMS with a Monitoring Agent has started
flow.status.agentChatEnded2-way SMS with a Monitoring Agent has ended
flow.status.smsNoResponseThe user(s) did not respond to the verification attempt
flow.status.smsConfirmUser(s) confirmed a request for emergency services
flow.status.smsCancelUser(s) canceled a request for emergency services
flow.status.smsFailThe SMS did not reach the user(s)
flow.status.monitoringThe event is being escalated to a Monitoring Agent
flow.status.monitoringFailThe event could not be escalated to a Monitoring Agent
flow.status.monitoring_authorities_dispatchedThe Monitoring Agent contacted emergency services
flow.status.monitoring_event_canceledThe Monitoring Agent did not request emergency dispatch due to lack of verification or user request
flow.status.flowEndThe RapidSOS workflow has ended
flow.update.locationThe new location was processed
flow.update.dataThe data update was processed
flow.update.mediaThe new media file was processed