# POST /notification-settings

**Create a notification setting**

Creates a new notification setting (notification destination).

Pass an array of event type names to `subscribed_events` to say which events you'd like to subscribe to. Paddle responds with the full event type object for each event type.

If successful, your response includes a copy of the new notification setting entity. Use the returned `endpoint_secret_key` for webhook signature verification.

**Required permissions:** `notification_setting.write`

## Request body

- `description`: string (required) — Short description for this notification destination. Shown in the Paddle Dashboard. (Length: 1–500)
- `type`: string (required) — Where notifications should be sent for this destination.
- `destination`: string (required) — Webhook endpoint URL or email address. (Length: 1–2048)
- `api_version`: integer — API version that returned objects for events should conform to. Must be a valid version of the Paddle API. Can't be a version older than your account default. If omitted, defaults to your account default version. (Min: 1)
- `include_sensitive_fields`: boolean — Whether potentially sensitive fields should be sent to this notification destination. If omitted, defaults to `false`.
- `subscribed_events`: array (required) — Subscribed events for this notification destination. When creating or updating a notification destination, pass an array of event type names only. Paddle returns the complete event type object.
- `traffic_source`: string — Whether Paddle should deliver real platform events, simulation events or both to this notification destination. If omitted, defaults to `platform`.

### Request example

```json
{
  "description": "Slack notifications",
  "type": "url",
  "destination": "https://hooks.slack.com/example",
  "api_version": 1,
  "traffic_source": "all",
  "subscribed_events": [
    "transaction.billed",
    "transaction.canceled",
    "transaction.completed",
    "transaction.created",
    "transaction.payment_failed",
    "transaction.ready",
    "transaction.updated",
    "subscription.activated",
    "subscription.created",
    "subscription.past_due",
    "subscription.paused",
    "subscription.resumed",
    "subscription.trialing",
    "subscription.updated"
  ]
}
```

## Response (201)

- `data`: object (required) — Represents a notification destination.
  - `id`: string (required) — Unique Paddle ID for this notification setting, prefixed with `ntfset_`. (pattern: `^ntfset_[a-z\d]{26}$`)
  - `description`: string (required) — Short description for this notification destination. Shown in the Paddle dashboard. (Length: 1–500)
  - `type`: string (required) — Where notifications should be sent for this destination.
  - `destination`: string (required) — Webhook endpoint URL or email address. (Length: 1–2048)
  - `active`: boolean (required) — Whether Paddle should try to deliver events to this notification destination.
  - `api_version`: integer (required) — API version that returned objects for events should conform to. Must be a valid version of the Paddle API. Can't be a version older than your account default. (Min: 1)
  - `include_sensitive_fields`: boolean (required) — Whether potentially sensitive fields should be sent to this notification destination.
  - `subscribed_events`: array (required) — Subscribed events for this notification destination.
  - `endpoint_secret_key`: string (required) — Webhook destination secret key, prefixed with `pdl_ntfset_`. Used for signature verification. (pattern: `^pdl_ntfset_[a-zA-Z0-9]{26}_[a-zA-Z0-9]{32}$`)
  - `traffic_source`: string (required) — Whether Paddle should deliver real platform events, simulation events or both to this notification destination.
- `meta`: object (required) — Information about this response.
  - `request_id`: string (required) — Unique ID for the request relating to this response. Provide this when contacting Paddle support about a specific request.

### Response example

```json
{
  "data": {
    "id": "ntfset_01gkpjp8bkm3tm53kdgkx6sms7",
    "description": "Slack notifications",
    "type": "url",
    "destination": "https://hooks.slack.com/example",
    "active": true,
    "api_version": 1,
    "include_sensitive_fields": false,
    "traffic_source": "all",
    "subscribed_events": [
      {
        "name": "transaction.billed",
        "description": "Occurs when a transaction is billed.",
        "group": "Transaction",
        "available_versions": [
          1
        ]
      },
      {
        "name": "transaction.canceled",
        "description": "Occurs when a transaction is canceled.",
        "group": "Transaction",
        "available_versions": [
          1
        ]
      },
      {
        "name": "transaction.completed",
        "description": "Occurs when a transaction is completed.",
        "group": "Transaction",
        "available_versions": [
          1
        ]
      },
      {
        "name": "transaction.created",
        "description": "Occurs when a transaction is created.",
        "group": "Transaction",
        "available_versions": [
          1
        ]
      },
      {
        "name": "transaction.payment_failed",
        "description": "Occurs when a payment fails for a transaction.",
        "group": "Transaction",
        "available_versions": [
          1
        ]
      },
      {
        "name": "transaction.ready",
        "description": "Occurs when a transaction is ready.",
        "group": "Transaction",
        "available_versions": [
          1
        ]
      },
      {
        "name": "transaction.updated",
        "description": "Occurs when a transaction is updated.",
        "group": "Transaction",
        "available_versions": [
          1
        ]
      },
      {
        "name": "subscription.activated",
        "description": "Occurs when a subscription is activated.",
        "group": "Subscription",
        "available_versions": [
          1
        ]
      },
      {
        "name": "subscription.canceled",
        "description": "Occurs when a subscription is canceled.",
        "group": "Subscription",
        "available_versions": [
          1
        ]
      },
      {
        "name": "subscription.created",
        "description": "Occurs when a subscription is created.",
        "group": "Subscription",
        "available_versions": [
          1
        ]
      },
      {
        "name": "subscription.past_due",
        "description": "Occurs when a subscription is past due.",
        "group": "Subscription",
        "available_versions": [
          1
        ]
      },
      {
        "name": "subscription.paused",
        "description": "Occurs when a subscription is paused.",
        "group": "Subscription",
        "available_versions": [
          1
        ]
      },
      {
        "name": "subscription.resumed",
        "description": "Occurs when a subscription is resumed.",
        "group": "Subscription",
        "available_versions": [
          1
        ]
      },
      {
        "name": "subscription.trialing",
        "description": "Occurs when a subscription is trialing.",
        "group": "Subscription",
        "available_versions": [
          1
        ]
      },
      {
        "name": "subscription.updated",
        "description": "Occurs when a subscription is updated.",
        "group": "Subscription",
        "available_versions": [
          1
        ]
      }
    ],
    "endpoint_secret_key": "pdl_ntfset_01gkpjp8bkm3tm53kdgkx6sms7_6h3qd3uFSi9YCD3OLYAShQI90XTI5vEI"
  },
  "meta": {
    "request_id": "fd55d51a-6242-4645-8572-af2a8b6f41b6"
  }
}
```
