Skip to main content
POST
/
v1
/
channel-endpoints
PHP
declare(strict_types=1);

require 'vendor/autoload.php';

use novu;
use novu\Models\Components;

$sdk = novu\Novu::builder()
    ->setSecurity(
        'YOUR_SECRET_KEY_HERE'
    )
    ->build();



$response = $sdk->channelEndpoints->create(
    requestBody: new Components\CreateSlackChannelEndpointDto(
        subscriberId: 'subscriber-123',
        integrationIdentifier: 'slack-prod',
        type: Components\CreateSlackChannelEndpointDtoType::SlackChannel,
        endpoint: new Components\SlackChannelEndpointDto(
            channelId: 'C123456789',
        ),
    )
);

if ($response->getChannelEndpointResponseDto !== null) {
    // handle response
}
{
  "identifier": "<string>",
  "providerId": "slack",
  "integrationIdentifier": "slack-prod",
  "connectionIdentifier": "slack-connection-abc123",
  "subscriberId": "subscriber-123",
  "contextKeys": [
    "tenant:org-123",
    "region:us-east-1"
  ],
  "type": "slack_channel",
  "endpoint": {
    "channelId": "C123456789"
  },
  "createdAt": "<string>",
  "updatedAt": "<string>"
}

Authorizations

Authorization
string
header
required

API key authentication. Allowed headers-- "Authorization: ApiKey <novu_secret_key>".

Headers

idempotency-key
string

A header for idempotency purposes

Body

application/json

Channel endpoint creation request. The structure varies based on the type field.

subscriberId
string
required

The subscriber ID to which the channel endpoint is linked

Example:

"subscriber-123"

integrationIdentifier
string
required

The identifier of the integration to use for this channel endpoint.

Example:

"slack-prod"

type
enum<string>
required

Type of channel endpoint

Available options:
slack_channel
Example:

"slack_channel"

endpoint
object
required

Slack channel endpoint data

identifier
string

The unique identifier for the channel endpoint. If not provided, one will be generated automatically.

Example:

"slack-channel-user123-abc4"

context
object
connectionIdentifier
string

The identifier of the channel connection to use for this channel endpoint.

Example:

"slack-connection-abc123"

Response

Created

identifier
string
required

The unique identifier of the channel endpoint.

channel
enum<string> | null
required

The channel type (email, sms, push, chat, etc.).

Available options:
in_app,
email,
sms,
chat,
push
providerId
enum<string> | null
required

The provider identifier (e.g., sendgrid, twilio, slack, etc.).

Available options:
emailjs,
mailgun,
mailjet,
mandrill,
nodemailer,
postmark,
sendgrid,
sendinblue,
ses,
netcore,
infobip-email,
resend,
plunk,
mailersend,
mailtrap,
clickatell,
outlook365,
novu-email,
sparkpost,
email-webhook,
braze,
novu-email-agent,
nexmo,
plivo,
sms77,
sms-central,
sns,
telnyx,
twilio,
gupshup,
firetext,
infobip-sms,
burst-sms,
bulk-sms,
isend-sms,
forty-six-elks,
kannel,
maqsam,
termii,
africas-talking,
novu-sms,
sendchamp,
generic-sms,
clicksend,
bandwidth,
messagebird,
simpletexting,
azure-sms,
ring-central,
brevo-sms,
eazy-sms,
mobishastra,
afro-message,
unifonic,
smsmode,
imedia,
sinch,
isendpro-sms,
cm-telecom,
fcm,
apns,
expo,
one-signal,
pushpad,
push-webhook,
pusher-beams,
appio,
novu,
slack,
discord,
msteams,
mattermost,
ryver,
zulip,
grafana-on-call,
getstream,
rocket-chat,
whatsapp-business,
chat-webhook,
novu-slack,
telegram,
anthropic,
novu-anthropic,
anthropic-aws
Example:

"slack"

integrationIdentifier
string | null
required

The identifier of the integration to use for this channel endpoint.

Example:

"slack-prod"

connectionIdentifier
string | null
required

The identifier of the channel connection used for this endpoint.

Example:

"slack-connection-abc123"

subscriberId
string | null
required

The subscriber ID to which the channel endpoint is linked

Example:

"subscriber-123"

contextKeys
string[]
required

The context of the channel connection

Example:
["tenant:org-123", "region:us-east-1"]
type
enum<string>
required

Type of channel endpoint

Available options:
slack_channel,
slack_user,
webhook,
phone,
ms_teams_channel,
ms_teams_user,
telegram_chat
Example:

"slack_channel"

endpoint
object
required

Endpoint data specific to the channel type

createdAt
string
required

The timestamp indicating when the channel endpoint was created, in ISO 8601 format.

updatedAt
string
required

The timestamp indicating when the channel endpoint was last updated, in ISO 8601 format.