Skip to the page

Add webhook

Adds an endpoint that is told about the events you pick. The signing secret is in this answer and is never shown again.

opensend.webhooks.create(input)
Needs the scopewebhooks:writeFrom a terminalopensend webhooks create

Input

  • urlstringRequired

    A public https:// address of yours that takes a POST. Up to 500 characters.

  • eventsstring[]

    The events to be told about. Without it the webhook gets every event. Default: ["email.sent","email.delivered","email.delayed","email.bounced","email.opened","email.clicked","email.complained","email.failed","email.received","email.scheduled","email.canceled","automation.entered","automation.finished","automation.step"].

    One ofemail.sentemail.deliveredemail.delayedemail.bouncedemail.openedemail.clickedemail.complainedemail.failedemail.receivedemail.scheduledemail.canceledautomation.enteredautomation.finishedautomation.step

  • formatstring

    How an event is written and signed. resend sends the svix-id, svix-timestamp and svix-signature headers and the body an endpoint built for Resend already reads. Without it, native.

    One ofnativeresend

  • secretstring

    The signing secret the endpoint already checks with, as Resend gave it: whsec_ and Base64. Only for the resend format. Without it a new secret is made.

Returns

The call resolves to the answer, already parsed. A call the API refuses throws OpenSendError with the code and the message of the answer. SDK lists the errors of the client itself.

  • object"webhook"

    Always webhook.

  • idstring

    The id of the webhook.

  • urlstring

    The address events are posted to.

  • eventsstring[]

    The events it is told about.

    One ofemail.sentemail.deliveredemail.delayedemail.bouncedemail.openedemail.clickedemail.complainedemail.failedemail.receivedemail.scheduledemail.canceledautomation.enteredautomation.finishedautomation.step

  • statusstring

    enabled while events are posted to it, disabled when it is switched off.

    One ofenableddisabled

  • formatstring

    How an event is written and signed: native is this API, resend is the headers, signature and body an endpoint built for Resend expects.

    One ofnativeresend

  • lastDeliveryAtstring | null

    When an event was last posted to it, or null.

  • lastStatusinteger | null

    The HTTP status your address answered with last time, or null.

  • createdAtstring

    When the webhook was added.

  • secretstring

    The secret to check signatures with. It is shown this once and cannot be read again.