Back to Novu

Create a channel endpoint

docs/api-reference/channel-endpoints/create-a-channel-endpoint.mdx

3.19.01.9 KB
Original Source

Create a channel endpoint to register a subscriber-specific delivery target (Slack channel, phone number, PagerDuty routing key, Tool Webhook URL, and other variants). The request body uses a discriminated type field; each variant carries its own endpoint object shape.

tool_webhook variant

Use type tool_webhook with a Tool Webhook integration configured for Dynamic routing. A subscriber may have multiple tool_webhook endpoints on the same integration — Novu delivers the Tool step once per endpoint.

FieldTypeDescription
type"tool_webhook"Discriminator for Tool Webhook dynamic routing.
integrationIdentifierstringIdentifier of the Tool Webhook integration.
subscriberIdstringSubscriber that owns this destination URL.
createSubscriberIfMissingbooleanOptional. When true, creates the subscriber if missing. Defaults to false.
endpoint.urlstringRequired. http: or https: URL. Stored encrypted on the linked channel connection.
endpoint.headersRecord<string, string>Optional. Per-endpoint headers; override integration defaults on key collision. Values stored encrypted.
endpoint.method"POST" | "PUT" | "PATCH"Optional. Overrides the integration HTTP method for this endpoint.

Example:

bash
curl -L -X POST 'https://api.novu.co/v1/channel-endpoints' \
-H 'Content-Type: application/json' \
-H 'Authorization: ApiKey <NOVU_SECRET_KEY>' \
-d '{
  "type": "tool_webhook",
  "integrationIdentifier": "tool-webhook",
  "subscriberId": "user-123",
  "createSubscriberIfMissing": true,
  "endpoint": {
    "url": "https://customer.example.com/hooks/novu",
    "headers": { "Authorization": "Bearer token" },
    "method": "POST"
  }
}'

See the Tool Webhook setup guide for static vs dynamic routing, header/body merge, and HMAC verification.