Review notification logs with the API
Payabli records a log entry for every notification it sends, whether that’s a webhook delivery, an email, an SMS, or a generated report. Use the notification logs API to confirm a notification reached its destination, find out why one didn’t, and send it again from your own tooling.
To work through logs in the Payabli Portal instead, see Review notification logs (Portal). For how Payabli delivers and retries notifications, see Notifications overview.
Considerations
Keep these considerations in mind when working with the notification logs API:
- The endpoints require the
notifications_readornotifications_createpermission. Retrying a notification requiresnotifications_create. - Each search must scope to an organization or a paypoint, so pass either
orgIdorpaypointId. - A search window can’t span more than 30 days between
startDateandendDate. - Payabli can’t retry some notifications at all, such as password-reset emails.
Search notification logs
Send a POST request to /v2/notificationlogs to search for notifications within a date range. Filter by event, delivery outcome, and owning entity, and page through the results. See the API reference for full documentation.
This example returns the first 20 successful approvedpayment notifications for an organization in January 2024:
A successful response returns an array of matching log entries, newest first:
Each entry’s notificationType identifies the delivery method: 1 (Email), 2 (SMS), or 3 (Webhook).
Filter the search
Pass any of these fields in the request body to narrow the results:
Set the page size and page with the PageSize and Page query parameters. To triage failures, filter with succeeded: false and read the delivery fields on each entry.
Read the delivery outcome
Three fields tell you what happened to a delivery:
successistruewhen the target accepted the delivery andfalsewhen it didn’t.responseStatusCodeis the HTTP status code the target returned, such as200or500. It’s0when the target sent no response.responseStatusis the status message, such asOK,Dropped, orNo response received from server.
Read successDate and lastFailedDate together to see the delivery’s history. A lastFailedDate with no successDate means the delivery has failed and hasn’t succeeded since. Automatic retries may still be running, so check isInProgress before you step in.
Get notification details
Send a GET request to /v2/notificationlogs/{uuid} to retrieve one entry with the full request and response Payabli captured. See the API reference for full documentation.
Alongside the core notification fields, the detail response adds what left Payabli and what came back:
webHeadersare the custom headers Payabli sent with the notification, if any.responseHeadersare the headers the target returned, or null when the target sent no response.responseContentis the body the target returned, or empty when the target sent no response.
The webHeaders array shows those custom headers exactly as Payabli sent them.
webHeaders includes any custom headers configured on the webhook, with their values in plain text. Redact them before sharing a response in a ticket or a screenshot.
Tell a rejected delivery from an unreachable one
The responseStatusCode separates the two failures that look alike in a search:
- A status code, such as
401or500, means your endpoint received the request and rejected it. ReadresponseContentfor what your server returned, then fix the endpoint before you retry. - A
responseStatusCodeof0, withresponseStatusreadingNo response received from server., means Payabli couldn’t reach the endpoint. Confirm the URL is right and publicly reachable before you retry.
Retry a failed notification
Payabli retries a failed webhook twice on its own, waiting 5 minutes between tries. After the second failed retry, it marks the delivery failed and leaves it for you to retry. Fix whatever caused the failure first, because a retry to an endpoint that’s still broken fails the same way.
Send a GET request to /v2/notificationlogs/{uuid}/retry to retry a single notification. See the API reference for full documentation.
Payabli resends the notification to its target and returns a confirmation message, not the updated log entry. Search for the notification again to confirm whether successDate fills in.
Retry several notifications
Send a POST request to /v2/notificationlogs/retry with an array of up to 50 notification IDs to retry them together. See the API reference for full documentation.
A bulk retry covers only failed webhooks and excludes emails. It runs asynchronously, so the response confirms only that Payabli accepted the request. Search the logs again after 2 to 5 minutes and check whether successDate fills in to confirm each delivery landed.
Related resources
See these related resources to help you get the most out of Payabli.
Prerequisites
- Notifications and reports overview - Get automated reports and notifications for key events
References
- Search notification logs - Search notification deliveries through the API