Update a channel connection
Update an existing channel connection by its unique identifier.
import { Novu } from "@novu/api";
const novu = new Novu({
secretKey: "YOUR_SECRET_KEY_HERE",
});
async function run() {
const result = await novu.channelConnections.update({
workspace: {
id: "T123456",
name: "Acme HQ",
},
auth: {
accessToken: "Workspace access token",
},
}, "<value>");
console.log(result);
}
run();using Novu;
using Novu.Models.Components;
var sdk = new NovuSDK(secretKey: "YOUR_SECRET_KEY_HERE");
var res = await sdk.ChannelConnections.UpdateAsync(
identifier: "<value>",
updateChannelConnectionRequestDto: new UpdateChannelConnectionRequestDto() {
Workspace = new WorkspaceDto() {
Id = "T123456",
Name = "Acme HQ",
},
Auth = new AuthDto() {
AccessToken = "Workspace access token",
},
}
);
// handle responsedeclare(strict_types=1);
require 'vendor/autoload.php';
use novu;
use novu\Models\Components;
$sdk = novu\Novu::builder()
->setSecurity(
'YOUR_SECRET_KEY_HERE'
)
->build();
$updateChannelConnectionRequestDto = new Components\UpdateChannelConnectionRequestDto(
workspace: new Components\WorkspaceDto(
id: 'T123456',
name: 'Acme HQ',
),
auth: new Components\AuthDto(
accessToken: 'Workspace access token',
),
);
$response = $sdk->channelConnections->update(
identifier: '<value>',
updateChannelConnectionRequestDto: $updateChannelConnectionRequestDto
);
if ($response->getChannelConnectionResponseDto !== null) {
// handle response
}from novu_py import Novu
with Novu(
secret_key="YOUR_SECRET_KEY_HERE",
) as novu:
res = novu.channel_connections.update(identifier="<value>", update_channel_connection_request_dto={
"workspace": {
"id": "T123456",
"name": "Acme HQ",
},
"auth": {
"access_token": "Workspace access token",
},
})
# Handle response
print(res)package main
import(
"context"
"github.com/novuhq/novu-go/v3"
"github.com/novuhq/novu-go/v3/models/components"
"log"
)
func main() {
ctx := context.Background()
s := v3.New(
v3.WithSecurity("YOUR_SECRET_KEY_HERE"),
)
res, err := s.ChannelConnections.Update(ctx, "<value>", components.UpdateChannelConnectionRequestDto{
Workspace: components.WorkspaceDto{
ID: "T123456",
Name: v3.Pointer("Acme HQ"),
},
Auth: components.AuthDto{
AccessToken: "Workspace access token",
},
}, nil)
if err != nil {
log.Fatal(err)
}
if res.GetChannelConnectionResponseDto != nil {
// handle response
}
}curl --request PATCH \
--url https://api.novu.co/v1/channel-connections/{identifier} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"workspace": {
"id": "T123456",
"name": "Acme HQ"
},
"auth": {
"accessToken": "Workspace access token"
}
}
'const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
workspace: {id: 'T123456', name: 'Acme HQ'},
auth: {accessToken: 'Workspace access token'}
})
};
fetch('https://api.novu.co/v1/channel-connections/{identifier}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.patch("https://api.novu.co/v1/channel-connections/{identifier}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"workspace\": {\n \"id\": \"T123456\",\n \"name\": \"Acme HQ\"\n },\n \"auth\": {\n \"accessToken\": \"Workspace access token\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.novu.co/v1/channel-connections/{identifier}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"workspace\": {\n \"id\": \"T123456\",\n \"name\": \"Acme HQ\"\n },\n \"auth\": {\n \"accessToken\": \"Workspace access token\"\n }\n}"
response = http.request(request)
puts response.read_body{
"identifier": "<string>",
"providerId": "slack",
"integrationIdentifier": "slack-prod",
"subscriberId": "subscriber-123",
"contextKeys": [
"tenant:org-123",
"region:us-east-1"
],
"workspace": {
"id": "T123456",
"name": "Acme HQ"
},
"auth": {
"accessToken": "Workspace access token"
},
"createdAt": "<string>",
"updatedAt": "<string>"
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"errors": {
"fieldName1": {
"messages": [
"Field is required",
"Must be a valid email address"
],
"value": "invalidEmail"
},
"fieldName2": {
"messages": [
"Must be at least 18 years old"
],
"value": 17
},
"fieldName3": {
"messages": [
"Must be a boolean value"
],
"value": true
},
"fieldName4": {
"messages": [
"Must be a valid object"
],
"value": {
"key": "value"
}
},
"fieldName5": {
"messages": [
"Field is missing"
],
"value": null
},
"fieldName6": {
"messages": [
"Undefined value"
]
}
},
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}"API rate limit exceeded"{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}"Please wait some time, then try again."Authorizations
API key authentication. Allowed headers-- "Authorization: ApiKey <novu_secret_key>".
Headers
A header for idempotency purposes
Path Parameters
The unique identifier of the channel connection
Body
Response
OK
The unique identifier of the channel endpoint.
The channel type (email, sms, push, chat, etc.).
in_app, email, sms, chat, push The provider identifier (e.g., sendgrid, twilio, slack, etc.).
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 "slack"
The identifier of the integration to use for this channel endpoint.
"slack-prod"
The subscriber ID to which the channel connection is linked
"subscriber-123"
The context of the channel connection
["tenant:org-123", "region:us-east-1"]
Show child attributes
Show child attributes
Show child attributes
Show child attributes
The timestamp indicating when the channel endpoint was created, in ISO 8601 format.
The timestamp indicating when the channel endpoint was last updated, in ISO 8601 format.
Was this page helpful?
import { Novu } from "@novu/api";
const novu = new Novu({
secretKey: "YOUR_SECRET_KEY_HERE",
});
async function run() {
const result = await novu.channelConnections.update({
workspace: {
id: "T123456",
name: "Acme HQ",
},
auth: {
accessToken: "Workspace access token",
},
}, "<value>");
console.log(result);
}
run();using Novu;
using Novu.Models.Components;
var sdk = new NovuSDK(secretKey: "YOUR_SECRET_KEY_HERE");
var res = await sdk.ChannelConnections.UpdateAsync(
identifier: "<value>",
updateChannelConnectionRequestDto: new UpdateChannelConnectionRequestDto() {
Workspace = new WorkspaceDto() {
Id = "T123456",
Name = "Acme HQ",
},
Auth = new AuthDto() {
AccessToken = "Workspace access token",
},
}
);
// handle responsedeclare(strict_types=1);
require 'vendor/autoload.php';
use novu;
use novu\Models\Components;
$sdk = novu\Novu::builder()
->setSecurity(
'YOUR_SECRET_KEY_HERE'
)
->build();
$updateChannelConnectionRequestDto = new Components\UpdateChannelConnectionRequestDto(
workspace: new Components\WorkspaceDto(
id: 'T123456',
name: 'Acme HQ',
),
auth: new Components\AuthDto(
accessToken: 'Workspace access token',
),
);
$response = $sdk->channelConnections->update(
identifier: '<value>',
updateChannelConnectionRequestDto: $updateChannelConnectionRequestDto
);
if ($response->getChannelConnectionResponseDto !== null) {
// handle response
}from novu_py import Novu
with Novu(
secret_key="YOUR_SECRET_KEY_HERE",
) as novu:
res = novu.channel_connections.update(identifier="<value>", update_channel_connection_request_dto={
"workspace": {
"id": "T123456",
"name": "Acme HQ",
},
"auth": {
"access_token": "Workspace access token",
},
})
# Handle response
print(res)package main
import(
"context"
"github.com/novuhq/novu-go/v3"
"github.com/novuhq/novu-go/v3/models/components"
"log"
)
func main() {
ctx := context.Background()
s := v3.New(
v3.WithSecurity("YOUR_SECRET_KEY_HERE"),
)
res, err := s.ChannelConnections.Update(ctx, "<value>", components.UpdateChannelConnectionRequestDto{
Workspace: components.WorkspaceDto{
ID: "T123456",
Name: v3.Pointer("Acme HQ"),
},
Auth: components.AuthDto{
AccessToken: "Workspace access token",
},
}, nil)
if err != nil {
log.Fatal(err)
}
if res.GetChannelConnectionResponseDto != nil {
// handle response
}
}curl --request PATCH \
--url https://api.novu.co/v1/channel-connections/{identifier} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"workspace": {
"id": "T123456",
"name": "Acme HQ"
},
"auth": {
"accessToken": "Workspace access token"
}
}
'const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
workspace: {id: 'T123456', name: 'Acme HQ'},
auth: {accessToken: 'Workspace access token'}
})
};
fetch('https://api.novu.co/v1/channel-connections/{identifier}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.patch("https://api.novu.co/v1/channel-connections/{identifier}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"workspace\": {\n \"id\": \"T123456\",\n \"name\": \"Acme HQ\"\n },\n \"auth\": {\n \"accessToken\": \"Workspace access token\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.novu.co/v1/channel-connections/{identifier}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"workspace\": {\n \"id\": \"T123456\",\n \"name\": \"Acme HQ\"\n },\n \"auth\": {\n \"accessToken\": \"Workspace access token\"\n }\n}"
response = http.request(request)
puts response.read_body{
"identifier": "<string>",
"providerId": "slack",
"integrationIdentifier": "slack-prod",
"subscriberId": "subscriber-123",
"contextKeys": [
"tenant:org-123",
"region:us-east-1"
],
"workspace": {
"id": "T123456",
"name": "Acme HQ"
},
"auth": {
"accessToken": "Workspace access token"
},
"createdAt": "<string>",
"updatedAt": "<string>"
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"errors": {
"fieldName1": {
"messages": [
"Field is required",
"Must be a valid email address"
],
"value": "invalidEmail"
},
"fieldName2": {
"messages": [
"Must be at least 18 years old"
],
"value": 17
},
"fieldName3": {
"messages": [
"Must be a boolean value"
],
"value": true
},
"fieldName4": {
"messages": [
"Must be a valid object"
],
"value": {
"key": "value"
}
},
"fieldName5": {
"messages": [
"Field is missing"
],
"value": null
},
"fieldName6": {
"messages": [
"Undefined value"
]
}
},
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}"API rate limit exceeded"{
"statusCode": 404,
"timestamp": "2024-12-12T13:00:00Z",
"path": "/api/v1/resource",
"message": "xx xx xx ",
"ctx": {
"workflowId": "some_wf_id",
"stepId": "some_wf_id"
},
"errorId": "abc123"
}"Please wait some time, then try again."