Create subscriber

Create subscriber with the given data

POST/v2/subscribers

Authorization

Authorization<token>

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

In: header

Request Body

application/jsonRequired
subscriberIdRequiredstring

Unique identifier of the subscriber

firstNamestring

First name of the subscriber

lastNamestring

Last name of the subscriber

emailstring

Email address of the subscriber

phonestring

Phone number of the subscriber

avatarstring

Avatar URL or identifier

timezonestring

Timezone of the subscriber

localestring

Locale of the subscriber

dataobject

Additional custom data for the subscriber

Header Parameters

idempotency-keystring

A header for idempotency purposes

curl -X POST "https://api.novu.co/v2/subscribers" \
  -H "idempotency-key: <string>" \
  -H "Authorization: <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "subscriberId": "string",
    "firstName": "string",
    "lastName": "string",
    "email": "string",
    "phone": "string",
    "avatar": "string",
    "timezone": "string",
    "locale": "string",
    "data": {}
  }'

Created

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