Back to Novu

Subscriber schema

docs/api-reference/subscribers/subscriber-schema.mdx

3.18.06.1 KB
Original Source

Subscriber

Subscriber is the end user that receives notifications. Subscriber has subscriber attributes like firstName, lastName, email, phone, etc, data field to store any custom attributes in key value pairs and channel credentials for push and chat channel provider's integrations. Read more about subscribers on subscribers concept page.

<ResponseField name="id" type="string"> The internal ID generated by Novu for your subscriber. This ID does not match the `subscriberId` used in your queries. Refer to `subscriberId` for that identifier. </ResponseField> <ResponseField name="firstName" type="string"> The first name of the subscriber. </ResponseField> <ResponseField name="lastName" type="string"> The last name of the subscriber. </ResponseField> <ResponseField name="email" type="string"> The email address of the subscriber. </ResponseField> <ResponseField name="phone" type="string"> The phone number of the subscriber. </ResponseField> <ResponseField name="avatar" type="string"> The URL of the subscriber's avatar image. </ResponseField> <ResponseField name="locale" type="string"> The locale setting of the subscriber, indicating their preferred language or region. </ResponseField> <ResponseField name="channels" type="ChannelSettingsDto[]"> An array of channel settings associated with the subscriber. </ResponseField> <ResponseField name="topics" type="string[]"> An array of topics that the subscriber is subscribed to. </ResponseField> <ResponseField name="isOnline" type="boolean"> Indicates whether the subscriber is currently online. </ResponseField> <ResponseField name="lastOnlineAt" type="string"> The timestamp indicating when the subscriber was last online, in ISO 8601 format. </ResponseField> <ResponseField name="v" type="number"> The version of the subscriber document. </ResponseField> <ResponseField name="data" type="{ [k: string]: any; }"> Additional custom data for the subscriber </ResponseField> <ResponseField name="timezone" type="string"> Timezone of the subscriber </ResponseField> <ResponseField name="subscriberId" type="string"> The identifier used to create this subscriber, which typically corresponds to the user ID in your system. </ResponseField> <ResponseField name="organizationId" type="string"> The unique identifier of the organization to which the subscriber belongs. </ResponseField> <ResponseField name="environmentId" type="string"> The unique identifier of the environment associated with this subscriber. </ResponseField> <ResponseField name="deleted" type="boolean"> Indicates whether the subscriber has been deleted. </ResponseField> <ResponseField name="createdAt" type="string"> The timestamp indicating when the subscriber was created, in ISO 8601 format. </ResponseField> <ResponseField name="updatedAt" type="string"> The timestamp indicating when the subscriber was last updated, in ISO 8601 format. </ResponseField>

ChannelSettingsDto

ChannelSettings are credentials for push and chat channel provider's integrations. One subscriber can have credentials for multiple integrations of same provider of one channel type

<ResponseField name="providerId" type="ChatOrPushProviderEnum"> The provider identifier for the credentials </ResponseField> <ResponseField name="integrationIdentifier" type="string"> The integration identifier </ResponseField> <ResponseField name="credentials" type="ChannelCredentials"> Credentials payload for the specified provider </ResponseField> <ResponseField name="integrationId" type="string"> The unique identifier of the integration associated with this channel. </ResponseField>

Credentials

Credentials like deviceTokens, webhookUrl, etc for a specific integration. providerId could be chat channel providerId or push channel providerId.

<ResponseField name="apiKey" type="string" /> <ResponseField name="user" type="string" /> <ResponseField name="secretKey" type="string" /> <ResponseField name="domain" type="string" /> <ResponseField name="password" type="string" /> <ResponseField name="host" type="string" /> <ResponseField name="port" type="string" /> <ResponseField name="secure" type="boolean" /> <ResponseField name="region" type="string" /> <ResponseField name="accountSid" type="string" /> <ResponseField name="messageProfileId" type="string" /> <ResponseField name="token" type="string" /> <ResponseField name="from" type="string" /> <ResponseField name="senderName" type="string" /> <ResponseField name="projectName" type="string" /> <ResponseField name="applicationId" type="string" /> <ResponseField name="clientId" type="string" /> <ResponseField name="requireTls" type="boolean" /> <ResponseField name="ignoreTls" type="boolean" /> <ResponseField name="tlsOptions" type="TlsOptions" /> <ResponseField name="baseUrl" type="string" /> <ResponseField name="webhookUrl" type="string" /> <ResponseField name="redirectUrl" type="string" /> <ResponseField name="hmac" type="boolean" /> <ResponseField name="serviceAccount" type="string" /> <ResponseField name="ipPoolName" type="string" /> <ResponseField name="apiKeyRequestHeader" type="string" /> <ResponseField name="secretKeyRequestHeader" type="string" /> <ResponseField name="idPath" type="string" /> <ResponseField name="datePath" type="string" /> <ResponseField name="apiToken" type="string" /> <ResponseField name="authenticateByToken" type="boolean" /> <ResponseField name="authenticationTokenKey" type="string" /> <ResponseField name="instanceId" type="string" /> <ResponseField name="alertUid" type="string" /> <ResponseField name="title" type="string" /> <ResponseField name="imageUrl" type="string" /> <ResponseField name="state" type="string" /> <ResponseField name="externalLink" type="string" /> <ResponseField name="channelId" type="string" /> <ResponseField name="phoneNumberIdentification" type="string" /> <ResponseField name="accessKey" type="string" /> <ResponseField name="appSid" type="string" /> <ResponseField name="senderId" type="string" /> <ResponseField name="tenantId" type="string" /> <ResponseField name="appIOBaseUrl" type="string" />