Upsert subscriber

Used to upsert the subscriber entity with new information

PUT
/v1/subscribers/{subscriberId}

Authorization

Authorization<token>

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

In: header

Request Body

application/jsonRequired
emailstring

The email address of the subscriber.

firstNamestring

The first name of the subscriber.

lastNamestring

The last name of the subscriber.

phonestring

The phone number of the subscriber.

avatarstring

The avatar URL of the subscriber.

localestring

The locale of the subscriber, for example "en-US".

dataobject

Custom data associated with the subscriber. Can contain any additional properties.

channelsarray<object>

An array of communication channels for the subscriber.

Path Parameters

subscriberIdRequiredstring

Header Parameters

idempotency-keystring

A header for idempotency purposes

curl -X PUT "https://api.novu.co/v1/subscribers/string" \
  -H "idempotency-key: string" \
  -H "Authorization: <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "john.doe@example.com",
    "firstName": "John",
    "lastName": "Doe",
    "phone": "+1234567890",
    "avatar": "https://example.com/avatar.jpg",
    "locale": "en-US",
    "data": {
      "preferences": {
        "notifications": true,
        "theme": "dark"
      },
      "tags": [
        "premium",
        "newsletter"
      ]
    },
    "channels": [
      {
        "providerId": "slack",
        "integrationIdentifier": "string",
        "credentials": {
          "webhookUrl": "string",
          "deviceTokens": [
            "string"
          ]
        }
      }
    ]
  }'

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"
}