I'm currently trying to make sure my app that uses Plaid, can recover from hooks not received within last 24 hours.
When a new event happens, Plaid sends a webhook and if its not successful it retries up to 24 hours.
But what if that window is missed?
I see the docs state:
If you (or Plaid) experience downtime for longer than Plaid's retry period, you will lose webhooks. If you use webhooks for state transitions, ensure your application can self-heal by requesting Item state from Plaid's other endpoints if a webhook is not received within a window. All data present in webhooks is also present in our other APIs.
But what does it mean with self-heal
?
Can I start requesting webhooks somehow?
Does the /item/get
make the webhooks start working again?
That documentation is poorly worded, but essentially means implementing an alternative flow if webhooks are not working. The exact details of this will depend on the business logic of your app.
For example: let's say you're using Auth, and you rely on the SMS_MICRODEPOSITS_VERIFICATION
webhook to know that the end user has verified their account via micro-deposits. The text here is suggesting that you have some kind of polling or recovery mechanism where if you know your webhook receiver was down, or if the webhook was expected but not received, you call /accounts/get
to check the verification_status
field, which contains the same information that the webhook would have given.
As an aside, you actually can get the value of the most recent webhook sent about an Item via the last_webhook
field returned by /item/get
, but because this only stores the last webhook and only provides the code and timestamp rather than the full body of the webhook, it might not be sufficient for all use cases.