Retrieve subscriber subscriptions
Retrieve subscriber's topic subscriptions by its unique key identifier subscriberId. Checkout all available filters in the query section.
Authorization
Authorization
<token>API key authentication. Allowed headers-- "Authorization: ApiKey <api_key>".
In: header
Path Parameters
subscriberId
RequiredstringThe identifier of the subscriber
Query Parameters
after
stringCursor for pagination indicating the starting point after which to fetch results.
before
stringCursor for pagination indicating the ending point before which to fetch results.
limit
numberLimit the number of items to return (max 100)
100
orderDirection
stringDirection of sorting
"ASC" | "DESC"
orderBy
stringField to order by
includeCursor
booleanInclude cursor item in response
key
stringFilter by topic key
Header Parameters
idempotency-key
stringA header for idempotency purposes
Response Body
OK
data
Requiredarray<object>List of returned Topic Subscriptions
next
Requiredstring | nullThe cursor for the next page of results, or null if there are no more pages.
previous
Requiredstring | nullThe cursor for the previous page of results, or null if this is the first page.
export interface Response {
/**
* List of returned Topic Subscriptions
*/
data: TopicSubscriptionResponseDto[];
/**
* The cursor for the next page of results, or null if there are no more pages.
*/
next: string | null;
/**
* The cursor for the previous page of results, or null if this is the first page.
*/
previous: string | null;
}
export interface TopicSubscriptionResponseDto {
/**
* The identifier of the subscription
*/
_id: string;
/**
* The date and time the subscription was created
*/
createdAt: string;
/**
* Topic information
*/
topic: TopicResponseDto;
/**
* Subscriber information
*/
subscriber: SubscriberDto;
}
export interface TopicResponseDto {
/**
* The identifier of the topic
*/
_id: string;
/**
* The unique key of the topic
*/
key: string;
/**
* The name of the topic
*/
name?: string;
/**
* The date the topic was created
*/
createdAt?: string;
/**
* The date the topic was last updated
*/
updatedAt?: string;
}
export interface SubscriberDto {
/**
* The identifier of the subscriber
*/
_id: string;
/**
* The external identifier of the subscriber
*/
subscriberId: string;
/**
* The avatar URL of the subscriber
*/
avatar?: string | null;
/**
* The first name of the subscriber
*/
firstName?: string | null;
/**
* The last name of the subscriber
*/
lastName?: string | null;
/**
* The email of the subscriber
*/
email?: string | null;
}
curl -X GET "https://api.novu.co/v2/subscribers/string/subscriptions?after=string&before=string&limit=100&orderDirection=ASC&orderBy=string&includeCursor=true&key=string" \
-H "idempotency-key: string" \
-H "Authorization: <token>"
{
"data": [
{
"_id": "64da692e9a94fb2e6449ad08",
"createdAt": "2021-01-01T00:00:00.000Z",
"topic": {
"_id": "64da692e9a94fb2e6449ad06",
"key": "product-updates",
"name": "Product Updates",
"createdAt": "2023-08-15T00:00:00.000Z",
"updatedAt": "2023-08-15T00:00:00.000Z"
},
"subscriber": {
"_id": "64da692e9a94fb2e6449ad07",
"subscriberId": "user-123",
"avatar": "https://example.com/avatar.png",
"firstName": "John",
"lastName": "Doe",
"email": "john@example.com"
}
}
],
"next": "string",
"previous": "string"
}