Skip to main content
POST
/
webhooks
JavaScript
import Nuntly from '@nuntly/sdk';

const client = new Nuntly({
  apiKey: process.env['NUNTLY_API_KEY'], // This is the default and can be omitted
});

const webhook = await client.webhooks.create({
  endpointUrl: 'https://example.com',
  events: ['email.queued'],
});

console.log(webhook.id);
{
  "data": {
    "id": "<string>",
    "endpointUrl": "<string>",
    "status": "enabled",
    "events": [
      "email.queued"
    ],
    "signingSecret": "<string>",
    "createdAt": "<string>",
    "name": "<string>"
  }
}

Authorizations

Authorization
string
header
required

Bearer HTTP authentication. Allowed headers Authorization: Bearer <API_KEY>

Body

application/json

Request to create a webhook

endpointUrl
string<uri>
required

The endpoint URL of the webhook

events
enum<string>[]
required
Minimum array length: 1

An event

Available options:
email.queued,
email.scheduled,
email.processed,
email.sending,
email.sent,
email.delivered,
email.opened,
email.clicked,
email.bounced,
email.complained,
email.rejected,
email.deliveryDelayed,
email.failed,
email.renderingFailed,
email.subscribed,
email.unsubscribed
name
string

The name of the webhook

status
enum<string>

The status of the webhook.

Available options:
enabled,
disabled,
revoked

Response

200 response

data
object
required

Response after creating a webhook