POLICY_STREAM_UPDATES

This event occurs when a Policy Stream's daily run ends. It is sent once every change from the run can be read through sync, so when it arrives, call sync from your saved cursor.

It is only sent once Policy Stream is enabled for your team. Like other events, it is retried if your server doesn't respond with a success status.

Webhook Request Format

The webhook is a POST request with a JSON body that will look like the following:

{
  "event_type": "POLICY_STREAM_UPDATES",
  "team_id": "<TEAM_ID>",
  "is_sandbox": false,
  "data": {
    "policy_stream_id": "<POLICY_STREAM_ID>",
    "status": "ACTIVE",
    "run": {
      "run_id": "<RUN_ID>",
      "status": "SUCCESS",
      "items_done": 412,
      "items_failed": 0,
      "items_skipped": 0
    }
  }
}
Data keyData description
policy_stream_idID of the Policy Stream whose run ended.
statusThe stream's status when the webhook was sent: ACTIVE, NEEDS_REAUTH or PAUSED.
run.run_idID of the run.
run.statusSUCCESS when every item in the run succeeded. PARTIAL when any item failed or was not reached.
run.items_doneNumber of items in the run that succeeded.
run.items_failedNumber of items in the run that failed.
run.items_skippedNumber of items in the run that were not reached.

You may use GET /teams/:teamId/policystream/streams to see why a stream needs attention, in needs_reauth_reason.