PUT
/
v1
/
subscribers
/
{subscriberId}
/
credentials
SubscribersController_updateSubscriberChannel
import { Novu } from "@novu/api";
import { UpdateSubscriberChannelRequestDtoProviderId } from "@novu/api/models/components";

const novu = new Novu({
  apiKey: "<YOUR_API_KEY_HERE>",
});

async function run() {
  const result = await novu.subscribers.credentials.update("<value>", {
    providerId: UpdateSubscriberChannelRequestDtoProviderId.Pushpad,
    credentials: {
      webhookUrl: "<value>",
    },
  });

  // Handle the result
  console.log(result)
}

run();
{
  "_id": "<string>",
  "firstName": "<string>",
  "lastName": "<string>",
  "email": "<string>",
  "phone": "<string>",
  "avatar": "<string>",
  "locale": "<string>",
  "subscriberId": "<string>",
  "channels": [
    {
      "providerId": "slack",
      "integrationIdentifier": "<string>",
      "credentials": {
        "webhookUrl": "<string>",
        "channel": "<string>",
        "deviceTokens": [
          "<string>"
        ],
        "alertUid": "<string>",
        "title": "<string>",
        "imageUrl": "<string>",
        "state": "<string>",
        "externalUrl": "<string>"
      },
      "_integrationId": "<string>"
    }
  ],
  "isOnline": true,
  "lastOnlineAt": "<string>",
  "_organizationId": "<string>",
  "_environmentId": "<string>",
  "deleted": true,
  "createdAt": "<string>",
  "updatedAt": "<string>",
  "__v": 123
}
Enter your API key in the Authorization field like the example shown below:E.g ApiKey 18d2e625f05d80e

Authorizations

Authorization
string
header
required

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

Path Parameters

subscriberId
string
required

Body

application/json

Response

200
application/json

Ok

The response is of type object.