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. See How to use Policy Stream.

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 skipped because the run reached its deadline.
run.items_doneNumber of list pages and policy reads that succeeded.
run.items_failedNumber of list pages and policy reads that failed after their retries.
run.items_skippedNumber of list pages and policy reads the run did not reach before its deadline.

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