# Pending actions: events and webhooks
When a new pending action is instantiated in the system, a PendingActionCreated
event is dispatched. When a user completes the consent flow of a pending action, a PendingActionCompleted
event is dispatched. The events are accessible from the Event API and by webhooks.
Example PendingActionCreated
event webhook payload:
{
"id": "927bf478-e246-477f-b3ef-dfa4b806a640",
"name": "PendingActionCreated",
"created_at: "2022-07-29T13:12:30.500Z"
}
The id
of the event can be used to query the pending action associated with the event. Two different approaches can be used to accomplish this:
- Querying
GET /v3/pending_actions
using theevent_id
query parameter - Accessing the payload of the event using the Event API endpoint
GET /v3/events/:id
, and then using theindividual_id
from the payload object in the response to queryGET /v3/pending_actions
using theindividual_id
query parameter
TIP
Note that the second approach is suboptimal to the first approach and requires an additional request.
Example of the first approach using the event_id
query parameter:
GET /v3/pending_actions?event_id=927bf478-e246-477f-b3ef-dfa4b806a640
Content-Type: application/json
Authorization: Bearer <access_token>