import Nuntly from '@nuntly/sdk';
const client = new Nuntly({
apiKey: 'My API Key',
});
// Automatically fetches more pages as needed.
for await (const eventListResponse of client.webhooks.events.list()) {
console.log(eventListResponse.id);
}{
"data": [
{
"id": "<string>",
"webhook_id": "<string>",
"org_id": "<string>",
"event": "email.delivered",
"received_at": "2023-11-07T05:31:56Z",
"data": {
"id": "<string>",
"created_at": "<string>",
"type": "email.sent",
"data": {
"id": "<string>",
"org_id": "<string>",
"message_id": "<string>",
"sent_at": "<string>",
"enqueue_at": "<string>",
"domain": "<string>",
"domain_id": "<string>",
"from": "<string>",
"to": "<string>",
"subject": "<string>",
"send": {},
"bulk_id": "<string>",
"cc": "<string>",
"bcc": "<string>",
"reply_to": "<string>",
"headers": [
{
"name": "<string>",
"value": "<string>"
}
],
"tags": {}
},
"kind": "event"
},
"status": "success"
}
],
"next_cursor": "<string>"
}Return the last events sent by webhooks
import Nuntly from '@nuntly/sdk';
const client = new Nuntly({
apiKey: 'My API Key',
});
// Automatically fetches more pages as needed.
for await (const eventListResponse of client.webhooks.events.list()) {
console.log(eventListResponse.id);
}{
"data": [
{
"id": "<string>",
"webhook_id": "<string>",
"org_id": "<string>",
"event": "email.delivered",
"received_at": "2023-11-07T05:31:56Z",
"data": {
"id": "<string>",
"created_at": "<string>",
"type": "email.sent",
"data": {
"id": "<string>",
"org_id": "<string>",
"message_id": "<string>",
"sent_at": "<string>",
"enqueue_at": "<string>",
"domain": "<string>",
"domain_id": "<string>",
"from": "<string>",
"to": "<string>",
"subject": "<string>",
"send": {},
"bulk_id": "<string>",
"cc": "<string>",
"bcc": "<string>",
"reply_to": "<string>",
"headers": [
{
"name": "<string>",
"value": "<string>"
}
],
"tags": {}
},
"kind": "event"
},
"status": "success"
}
],
"next_cursor": "<string>"
}Bearer HTTP authentication. Allowed headers Authorization: Bearer <API_KEY>
The maximum number of items to return
1 <= x <= 30The cursor to use for pagination
A successful response
The events sent by a webhook
Show child attributes
The id of the webhook event
The id of the webhook
The id of the organization
Type of the event
email.sent, email.delivered, email.opened, email.clicked, email.bounced, email.complained, email.rejected, email.delivery_delayed, email.failed "email.delivered"
The timestamp when the event was received by the webhook system
The event payload
Show child attributes
email.sent Show child attributes
event Status of the webhook delivery attempt
success, pending, failed