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

const client = new Nuntly({
  apiKey: 'My API Key',
});

const webhook = await client.webhooks.create({
  endpoint_url: 'https://webhook.site/12345678-1234-5678-1234-123456789012',
  events: ['email.delivered', 'email.sent'],
  status: 'enabled',
});

console.log(webhook.id);
{
  "data": {
    "id": "wh_01jne5c7gr2mhwrqg4zqwf48y2",
    "org_id": "org_01jh6jk82zjq9deye73h0mzcaq",
    "name": "My webhook",
    "endpoint_url": "https://webhook.site/12345678-1234-5678-1234-123456789012",
    "events": [
      "email.delivered",
      "email.sent"
    ],
    "status": "enabled",
    "signing_secret": "2VERerverv3V3RVeververv",
    "created_at": "2025-03-03T14:08:22.552Z",
    "modified_at": "2025-03-03T14:08:22.552Z",
    "region": "eu-west-1",
    "kind": "webhook"
  }
}

Authorizations

Authorization
string
header
required

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

Body

application/json
endpoint_url
string<uri>
required

The endpoint URL of the webhook

status
enum<string>
required

The status of the webhook.

Available options:
enabled,
disabled,
revoked
events
enum<string>[]
required
Minimum length: 1
name
string

The name of the webhook

Response

A successful response

data
object
Example:
{
"id": "wh_01jne5c7gr2mhwrqg4zqwf48y2",
"org_id": "org_01jh6jk82zjq9deye73h0mzcaq",
"name": "My webhook",
"endpoint_url": "https://webhook.site/12345678-1234-5678-1234-123456789012",
"events": ["email.delivered", "email.sent"],
"status": "enabled",
"signing_secret": "2VERerverv3V3RVeververv",
"created_at": "2025-03-03T14:08:22.552Z",
"modified_at": "2025-03-03T14:08:22.552Z",
"region": "eu-west-1",
"kind": "webhook"
}
I