import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
const { data, error } = await resend.webhooks.list();
{
"object": "list",
"has_more": false,
"data": [
{
"id": "7ab123cd-ef45-6789-abcd-ef0123456789",
"created_at": "2023-09-10T10:15:30.000Z",
"status": "disabled",
"endpoint": "https://first-webhook.example.com/handler",
"events": ["email.sent"]
},
{
"id": "4dd369bc-aa82-4ff3-97de-514ae3000ee0",
"created_at": "2023-08-22T15:28:00.000Z",
"status": "enabled",
"endpoint": "https://second-webhook.example.com/receive",
"events": ["email.received"]
}
]
}
Retrieve a list of webhooks for the authenticated user.
import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
const { data, error } = await resend.webhooks.list();
{
"object": "list",
"has_more": false,
"data": [
{
"id": "7ab123cd-ef45-6789-abcd-ef0123456789",
"created_at": "2023-09-10T10:15:30.000Z",
"status": "disabled",
"endpoint": "https://first-webhook.example.com/handler",
"events": ["email.sent"]
},
{
"id": "4dd369bc-aa82-4ff3-97de-514ae3000ee0",
"created_at": "2023-08-22T15:28:00.000Z",
"status": "enabled",
"endpoint": "https://second-webhook.example.com/receive",
"events": ["email.received"]
}
]
}
limit parameter is optional. If you do not provide a limit, all webhooks will be returned in a single response.1001before parameter.after parameter.after or before parameter, not both. See our pagination guide for more information.import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
const { data, error } = await resend.webhooks.list();
{
"object": "list",
"has_more": false,
"data": [
{
"id": "7ab123cd-ef45-6789-abcd-ef0123456789",
"created_at": "2023-09-10T10:15:30.000Z",
"status": "disabled",
"endpoint": "https://first-webhook.example.com/handler",
"events": ["email.sent"]
},
{
"id": "4dd369bc-aa82-4ff3-97de-514ae3000ee0",
"created_at": "2023-08-22T15:28:00.000Z",
"status": "enabled",
"endpoint": "https://second-webhook.example.com/receive",
"events": ["email.received"]
}
]
}
Was this page helpful?