Update subscriber credentials

Subscriber credentials associated to the delivery methods such as slack and push tokens.

PUT/v1/subscribers/{subscriberId}/credentials

Authorization

Authorization<token>

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

In: header

Request Body

application/jsonRequired
providerIdRequiredstring

The provider identifier for the credentials

Value in: "slack" | "discord" | "msteams" | "mattermost" | "ryver" | "zulip" | "grafana-on-call" | "getstream" | "rocket-chat" | "whatsapp-business" | "fcm" | "apns" | "expo" | "one-signal" | "pushpad" | "push-webhook" | "pusher-beams"
integrationIdentifierstring

The integration identifier

credentialsRequiredobject

Credentials payload for the specified provider

Path Parameters

subscriberIdRequiredstring

Header Parameters

idempotency-keystring

A header for idempotency purposes

curl -X PUT "https://api.novu.co/v1/subscribers/<string>/credentials" \
  -H "idempotency-key: <string>" \
  -H "Authorization: <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "providerId": "slack",
    "integrationIdentifier": "string",
    "credentials": {
      "webhookUrl": "https://example.com/webhook",
      "channel": "general",
      "deviceTokens": [
        "token1",
        "token2",
        "token3"
      ],
      "alertUid": "12345-abcde",
      "title": "Critical Alert",
      "imageUrl": "https://example.com/image.png",
      "state": "resolved",
      "externalUrl": "https://example.com/details"
    }
  }'

OK

{
  "_id": "string",
  "firstName": "string",
  "lastName": "string",
  "email": "string",
  "phone": "string",
  "avatar": "string",
  "locale": "string",
  "subscriberId": "string",
  "channels": [
    {
      "providerId": "slack",
      "integrationIdentifier": "string",
      "credentials": {
        "webhookUrl": "https://example.com/webhook",
        "channel": "general",
        "deviceTokens": [
          "token1",
          "token2",
          "token3"
        ],
        "alertUid": "12345-abcde",
        "title": "Critical Alert",
        "imageUrl": "https://example.com/image.png",
        "state": "resolved",
        "externalUrl": "https://example.com/details"
      },
      "_integrationId": "string"
    }
  ],
  "topics": [
    "string"
  ],
  "isOnline": true,
  "lastOnlineAt": "string",
  "_organizationId": "string",
  "_environmentId": "string",
  "deleted": true,
  "createdAt": "string",
  "updatedAt": "string",
  "__v": 0,
  "data": {},
  "timezone": "string"
}