Webhook logs regarding failures are available for our customers for seven days. You can check information such as how many attempts were executed, the request/response body, the final execution status and more. The following endpoints are available to interact with the logs.
Note: if you have more than 10 webhook logs, the results may be paginated. To know more about how to use the nextPageToken to get the following results, refer to this pagination documentation.
Examples
Let's establish some of our data that will be used in the following examples:
In this example, we retrieve all logs for a subscription. It will show information such as the request ID and how many attempts were executed to try to deliver the event succesfully. With that information, you can get more details, such as the request body and response and more. We show how to do that in our next example.
curl -X GET "https://api.bird.com/organizations/823fbfaf-f14e-4693-b55a-8ec1c17d649e/workspaces/a1405560-c8d3-4b1a-877d-3f449ad95352/webhook-subscriptions/0edf722b-93b4-4451-8a5d-4fafba5cdf8b
-H"Content-Type: application/json" \-H "Authorization: AccessKey abcd"
Using the details route, you can get more information about the failures to deliver events. When querying a request ID (which can be found on the header of a request), you can obtain information about all delivery attempts. In the response example below, if there were 36 attempts, you would see 36 log details about each attempt.
{"results": [ {"organizationId":"823fbfaf-f14e-4693-b55a-8ec1c17d649e","workspaceId":"a1405560-c8d3-4b1a-877d-3f449ad95352","subscriptionId":"0edf722b-93b4-4451-8a5d-4fafba5cdf8b","requestId":"56878366-5417-414d-b1d9-5f250354f8d1","attemptCount":36,"httpStatusCode":429,"executionStatus":"failed","createdAt":"2024-11-25T18:32:46.962Z","updatedAt":"2024-11-25T18:32:46.962Z","payloadDetails": { "response": "<!DOCTYPE html>\n<html>\n<head>\n <title>Error: Request limit exceeded. Sign up to unlock more requests.</title>\n <link href=\"https://cdn.example.com/css/app.css\" rel=\"stylesheet\">\n</head>\n<body>\n<div class=\"container\" style=\"padding: 50px\">\n <div class=\"row\">\n <div class=\"col-sm-12 text-center\">\n <h1><img src=\"https://cdn.webhook.site/icon.png\" alt=\"Logo\" style=\"width:40px; margin-top: -5px\">\X</h1>\n\n <p class=\"lead\">Request limit exceeded. Sign up .</p>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-sm-4 col-sm-offset-4 text-center\">\n <p>\n You have been rate limited due to too many requests to this URL.\n This is either because you have not purchased\n, or the endpoint has a rate limit.<br>\n <br>\n To remove the request limit limit.\n <br><br>\n If you are already subscribed and getting this error, please <a href=\"https://</a>.\n <br><br>\n <a class=\"btn btn-lg btn-success\" href=\"/register\">Sign Up Now</a>\n </p>\n </div>\n </div>\n <div class=\"row\" style=\"margin-top: 40px\">\n <div class=\"col-sm-12 text-center\">\n <p class=\"small\"><a href=\"/\">\n <i class=\"bi-house-fill\"></i> Home</a>\n  \n <a href=\"/control-panel\">\n <i class=\"bi-gear-fill\"></i> Control Panel</a>\n  \n <a href=\"/register\">\n <i class=\"bi-person-add\"></i> Create Account</a>\n  \n\n <a href=\"/login\">\n <i class=\"bi-door-open-fill\"></i> Login</a></p\u003e\n <br>\n </div>\n </div>\n</div>\n</body>\n</html>\n",
"request": "{\"service\":\"channels\",\"event\":\"sms.outbound\",\"payload\":{\"id\":\"cb66df55-a060-4f37-be91-c8b8b4c4221e\",\"channelId\":\"8652c8f7-11e2-5f63-a03f-f2998f8bc6f5\",\"sender\":{\"connector\":{\"id\":\"e60a0e31-bb8f-4d56-97e7-3e50b157512d\",\"identifierValue\":\"+12345678\"}},\"receiver\":{\"contacts\":[{\"id\":\"34f282bf-7e19-4224-a1a7-05a63e4cfac9\",\"identifierKey\":\"phonenumber\",\"identifierValue\":\"+123456789\",\"countryCode\":\"NL\"}]},\"body\":{\"type\":\"text\",\"text\":{\"text\":\"help\"}},\"meta\":{},\"reference\":\"\",\"parts\":[{\"platformReference\":\"cb66df55-a060-4f37-be91-c8b8b4c4221e:b2d7a013-86df-4aa7-8245-8f3715c87ae2\"}],\"status\":\"sent\",\"validity\":129600,\"reason\":\"\",\"direction\":\"outgoing\",\"chargeableUnits\":1,\"lastStatusAt\":\"2024-11-25T10:30:00.39Z\",\"createdAt\":\"2024-11-25T10:29:59.757Z\",\"updatedAt\":\"2024-11-25T10:30:00.39Z\",\"batchId\":null}}"
} }, {"organizationId":"823fbfaf-f14e-4693-b55a-8ec1c17d649e","workspaceId":"a1405560-c8d3-4b1a-877d-3f449ad95352","subscriptionId":"0edf722b-93b4-4451-8a5d-4fafba5cdf8b","requestId":"56878366-5417-414d-b1d9-5f250354f8d1","attemptCount":1,"httpStatusCode":429,"executionStatus":"failed","createdAt":"2024-11-25T10:30:00.777Z","updatedAt":"2024-11-25T10:30:00.777Z","payloadDetails": { "response": "<!DOCTYPE html>\n<html>\n<head>\n <title>Error: Request limit exceeded. Sign up to unlock more requests.</title>\n <link href=\"https://cdn.example.com/css/app.css\" rel=\"stylesheet\">\n</head>\n<body>\n<div class=\"container\" style=\"padding: 50px\">\n <div class=\"row\">\n <div class=\"col-sm-12 text-center\">\n <h1><img src=\"https://cdn.webhook.site/icon.png\" alt=\"Logo\" style=\"width:40px; margin-top: -5px\">\X</h1>\n\n <p class=\"lead\">Request limit exceeded. Sign up .</p>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-sm-4 col-sm-offset-4 text-center\">\n <p>\n You have been rate limited due to too many requests to this URL.\n This is either because you have not purchased\n, or the endpoint has a rate limit.<br>\n <br>\n To remove the request limit limit.\n <br><br>\n If you are already subscribed and getting this error, please <a href=\"https://</a>.\n <br><br>\n <a class=\"btn btn-lg btn-success\" href=\"/register\">Sign Up Now</a>\n </p>\n </div>\n </div>\n <div class=\"row\" style=\"margin-top: 40px\">\n <div class=\"col-sm-12 text-center\">\n <p class=\"small\"><a href=\"/\">\n <i class=\"bi-house-fill\"></i> Home</a>\n  \n <a href=\"/control-panel\">\n <i class=\"bi-gear-fill\"></i> Control Panel</a>\n  \n <a href=\"/register\">\n <i class=\"bi-person-add\"></i> Create Account</a>\n  \n\n <a href=\"/login\">\n <i class=\"bi-door-open-fill\"></i> Login</a></p\u003e\n <br>\n </div>\n </div>\n</div>\n</body>\n</html>\n",
"request": "{\"service\":\"channels\",\"event\":\"sms.outbound\",\"payload\":{\"id\":\"cb66df55-a060-4f37-be91-c8b8b4c4221e\",\"channelId\":\"8652c8f7-11e2-5f63-a03f-f2998f8bc6f5\",\"sender\":{\"connector\":{\"id\":\"e60a0e31-bb8f-4d56-97e7-3e50b157512d\",\"identifierValue\":\"+12345678\"}},\"receiver\":{\"contacts\":[{\"id\":\"34f282bf-7e19-4224-a1a7-05a63e4cfac9\",\"identifierKey\":\"phonenumber\",\"identifierValue\":\"+123456789\",\"countryCode\":\"NL\"}]},\"body\":{\"type\":\"text\",\"text\":{\"text\":\"help\"}},\"meta\":{},\"reference\":\"\",\"parts\":[{\"platformReference\":\"cb66df55-a060-4f37-be91-c8b8b4c4221e:b2d7a013-86df-4aa7-8245-8f3715c87ae2\"}],\"status\":\"sent\",\"validity\":129600,\"reason\":\"\",\"direction\":\"outgoing\",\"chargeableUnits\":1,\"lastStatusAt\":\"2024-11-25T10:30:00.39Z\",\"createdAt\":\"2024-11-25T10:29:59.757Z\",\"updatedAt\":\"2024-11-25T10:30:00.39Z\",\"batchId\":null}}"
} } ]}