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 key | Data description |
|---|---|
| policy_stream_id | ID of the Policy Stream whose run ended. |
| status | The stream's status when the webhook was sent: ACTIVE, NEEDS_REAUTH or PAUSED. |
| run.run_id | ID of the run. |
| run.status | SUCCESS when every item in the run succeeded. PARTIAL when any item failed or was not reached. |
| run.items_done | Number of items in the run that succeeded. |
| run.items_failed | Number of items in the run that failed. |
| run.items_skipped | Number 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.

