Receive survey data with Webhooks

Webhooks are a powerful tool to deeply integrate Refiner and leverage survey data in your backend systems. When activated, Refiner sends data to a given API endpoint whenever new survey data is available.

Setting up webhooks

Refiner allows you to create multiple webhooks, each with their own configuration. This allows you to send survey data to different endpoints simultanously.

Start by navigating to the “Integrations > Webhooks” within your Refiner dashboard and click on “Create Webhook”.

You’ll be prompted to name your webhook, add a target URL and choose a trigger event.

In addition, you can also choose to include a secret token to validate and authorize incoming webhooks.

Webhook payload schema

As shown in the code sample below, Webhooks include survey responses alongside other user data.

The “attributes” object is probably the most important property of a webhook.

Attributes in Refiner contain the user data you provided when you identified your users, automatically generated data fields, as well as all survey responses we receive for a user.

Webhooks also include an “account” object. This object is only relevant if you are grouping your users when identifying them. If you don’t use the grouping feature, you can ignore the account object.

Below is an example of a typical webhook payload in Refiner.

{
    "uuid": "9205e5d0-f728-11ea-95d6-25411f8367ca",
    "project_uuid": "56421950-5d32-11ea-9bb4-9f1f1a987a49",
    "remote_id": "Your-User-ID",
    "email": "user@email.com",
    "first_seen_at": "2020-09-15T07:53:40.000000Z",
    "last_seen_at": "2020-09-15T07:53:48.000000Z",
    "attributes": {
        "did_you_hear_the_latest_news": "yes",
        "form_submissions_count": "1",
        "form_views_count": "1",
        "how_big_is_your_team": "10+",
        "plan": "enterprise",
    },
    "segments": [
        {
            "uuid": "56466b00-5d32-11ea-ac9b-ed991110cd88",
            "name": "All Users"
        },
        {
            "uuid": "63a027f0-9af2-11ea-b3cb-559f22ac4088",
            "name": "Active Users"
        },
        {
            "uuid": "001368e0-9f60-11ea-b34a-d43258357a51",
            "name": "Promoters"
        },
        {
            "uuid": "0611f7b0-9f60-11ea-9826-e14c34c4cf0",
            "name": "Power Users"
        }
    ],
    "account": {
        "uuid": "9206a9a0-f728-11ea-b411-7921dfc65301",
        "remote_id": null,
        "domain": null,
        "first_seen_at": "2020-09-15T07:53:40.000000Z",
        "last_seen_at": "2020-09-15T07:53:48.000000Z",
        "attributes": {
          
        }
    }
}