List all topics

This api returns a paginated list of topics. Topics can be filtered by key, name, or includeCursor to paginate through the list. Checkout all available filters in the query section.

GET
/v2/topics

Authorization

Authorization<token>

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

In: header

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

keystring

Key of the topic to filter results.

namestring

Name of the topic to filter results.

Header Parameters

idempotency-keystring

A header for idempotency purposes

Response Body

OK

dataRequiredarray<object>

List of returned Topics

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 Topics
   */
  data: TopicResponseDto[];
  /**
   * 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 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;
}
 
curl -X GET "https://api.novu.co/v2/topics?after=string&before=string&limit=100&orderDirection=ASC&orderBy=string&includeCursor=true&key=string&name=string" \
  -H "idempotency-key: string" \
  -H "Authorization: <token>"
{
  "data": [
    {
      "_id": "64da692e9a94fb2e6449ad06",
      "key": "product-updates",
      "name": "Product Updates",
      "createdAt": "2023-08-15T00:00:00.000Z",
      "updatedAt": "2023-08-15T00:00:00.000Z"
    }
  ],
  "next": "string",
  "previous": "string"
}