Webhooks

To receive notifications when flow sessions are completed, ProsperStack can deliver webhooks to your application.

Adding a webhook

Navigate to the webhooks configuration page by clicking Settings in the left navigation, then Manage integrations. Click Configure in the Webhooks section.

Click the Create a webhook link to create a new webhook.

Create a webhook

Enter the URL of your application endpoint that ProsperStack should deliver webhooks to and select which events the endpoint should receive.

  • flow_session.started — Occurs when a cancellation flow is started
  • flow_session.completed — Occurs when a cancellation flow is completed

Webhook payloads

Flow session started

The flow_session.started webhook is delivered whenever a new cancellation session is started. The payload contains information about the canceling subscriber and which cancellation flow they've been routed to.

Example payload:

{
  "event": "flow_session_started",
  "event_id": "evt_1TwEZeOiaN9qTNHO2vuctd2j",
  "data": {
    "status": "in_progress",
    "answers": [],
    "subscriber": {
      "email": "jane@example.com",
      "status": "active",
      "name": "Jane Doe",
      "updated_at": "2021-11-04T15:41:58.196Z",
      "created_at": "2021-11-04T15:41:58.196Z",
      "id": "subr_Odm0MLJ30coKpuWf460zikTb",
      "payment_provider_id": "C1c9-qkSnY3rGI2XABMlP",
      "properties": []
    },
    "flow": {
      "name": "Default",
      "updated_at": "2021-11-04T15:22:13.449Z",
      "created_at": "2021-11-04T15:22:13.424Z",
      "id": "flow_cMJ6T2tH56T2XngZdhBqpgtM"
    },
    "offers_presented": [],
    "updated_at": "2021-11-04T15:41:58.238Z",
    "created_at": "2021-11-04T15:41:58.238Z",
    "id": "sess_99aTIJuf30OWozAbvgu7Kje4",
    "offer_accepted": null
  }
}
Flow session completed

The flow_session.completed webhook is delivered whenever a cancellation session is completed. The payload contains the entire result of a flow session, including the status, survey answers and any offers presented or accepted.

Example payload:

{
  "event": "flow_session_completed",
  "event_id": "evt_ujO4n2g2QbWtGUVg1zJSbC5I",
  "data": {
    "id": "sess_Qxu1whWCpfYlX93hH3IIojdL",
    "status": "saved",
    "created_at": "2021-07-21T16:00:54.992Z",
    "updated_at": "2021-07-21T16:01:08.006Z",
    "subscriber": {
      "id": "subr_kBiRYxBUkZmEXqDRGNM7yLTN",
      "name": "Jane Doe",
      "email": "jane@example.com",
      "status": "active",
      "created_at": "2021-05-21T16:00:54.881Z",
      "updated_at": "2021-05-21T16:00:54.881Z"
    },
    "flow": {
      "name": "Default",
      "updated_at": "2021-11-04T15:22:13.449Z",
      "created_at": "2021-11-04T15:22:13.424Z",
      "id": "flow_cMJ6T2tH56T2XngZdhBqpgtM"
    },
    "offers_presented": [
      {
        "id": "offr_FBMw5k51DYga0K2WswbiFfMU",
        "type": "coupon",
        "name": "40% off for three months",
        "created_at": "2021-07-08T14:25:12.211Z",
        "updated_at": "2021-07-08T14:25:12.211Z"
      }
    ],
    "offer_accepted": {
      "id": "offr_FBMw5k51DYga0K2WswbiFfMU",
      "type": "coupon",
      "name": "40% off for three months",
      "created_at": "2021-07-08T14:25:12.211Z",
      "updated_at": "2021-07-08T14:25:12.211Z"
    },
    "answers": [
      {
        "question": {
          "id": "ques_e9PvoXmNB1WYYeNQOr6uRq1l",
          "type": "multiple_choice",
          "text": "What is your primary reason for leaving?"
        },
        "value": [
          {
            "id": "qopt_wrT7Rl362RVNi6eE2A4J8DLH",
            "text": "Not enough value / ROI"
          }
        ],
        "sentiment": null
      },
      {
        "question": {
          "id": "ques_acYB4paiWRGO5eFYJOAQy7XU",
          "type": "text",
          "text": "How can we improve?"
        },
        "value": "Really love the product, just can't afford it right now!",
        "sentiment": "positive"
      }
    ]
  }
}

Webhook retries

If delivering a webhook fails because your endpoint does not respond or returns an error, ProsperStack will attempt to retry the webhook for up to three days. If delivery continues to fail after three days, the webhook will be disabled and you'll receive an email to let you know that there was a problem completing the webhook delivery.

You can re-enable a disabled webhook from the webhook integrations page once any issues with the endpoint have been resolved.

Webhook limits

You can have up to ten webhooks configured with your ProsperStack account. If you need more, get in touch with us at support@prosperstack.com and we'll be happy to help.

Don't let customers slip away.