List topic subscriptions

List all topics that a subscriber is subscribed to. Checkout all available filters in the query section.

GET
/v2/topics/{topicKey}/subscriptions

Authorization

Authorization<token>

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

In: header

Path Parameters

topicKeyRequiredstring

The key identifier of the topic

Query Parameters

afterstring

Cursor for pagination indicating the starting point after which to fetch results.

beforestring

Cursor for pagination indicating the ending point before which to fetch results.

limitnumber

Limit the number of items to return (max 100)

Maximum: 100
orderDirectionstring

Direction of sorting

Value in: "ASC" | "DESC"
orderBystring

Field to order by

includeCursorboolean

Include cursor item in response

subscriberIdstring

Filter by subscriber ID

Header Parameters

idempotency-keystring

A header for idempotency purposes

Response Body

OK

dataRequiredarray<object>

List of returned Topic Subscriptions

nextRequiredstring | null

The cursor for the next page of results, or null if there are no more pages.

previousRequiredstring | null

The 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/topics/string/subscriptions?after=string&before=string&limit=100&orderDirection=ASC&orderBy=string&includeCursor=true&subscriberId=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"
}