List all contexts

Retrieve a paginated list of all contexts, optionally filtered by type and key pattern. type and id are optional fields, if provided, only contexts with the matching type and id will be returned. search is an optional field, if provided, only contexts with the matching key pattern will be returned. Checkout all possible parameters in the query section below for more details

GET
/v2/contexts

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

orderDirectionstring

Direction of sorting

Value in: "ASC" | "DESC"
orderBystring

Field to order by

includeCursorboolean

Include cursor item in response

idstring

Filter contexts by id

searchstring

Search contexts by type or id (supports partial matching across both fields)

Header Parameters

idempotency-keystring

A header for idempotency purposes

Response Body

OK

dataRequiredarray<object>

List of returned Contexts

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.

totalCountRequirednumber

The total count of items (up to 50,000)

totalCountCappedRequiredboolean

Whether there are more than 50,000 results available

export interface Response {
  /**
   * List of returned Contexts
   */
  data: GetContextResponseDto[];
  /**
   * 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;
  /**
   * The total count of items (up to 50,000)
   */
  totalCount: number;
  /**
   * Whether there are more than 50,000 results available
   */
  totalCountCapped: boolean;
}
export interface GetContextResponseDto {
  type: string;
  id: string;
  data: {};
  createdAt: string;
  updatedAt: string;
}
 
curl -X GET "https://api.novu.co/v2/contexts?after=string&before=string&limit=0&orderDirection=ASC&orderBy=string&includeCursor=true&id=tenant-prod-123&search=tenant" \
  -H "idempotency-key: string" \
  -H "Authorization: <token>"
{
  "data": [
    {
      "type": "string",
      "id": "string",
      "data": {},
      "createdAt": "string",
      "updatedAt": "string"
    }
  ],
  "next": "string",
  "previous": "string",
  "totalCount": 0,
  "totalCountCapped": true
}

On this page

No Headings
Edit this page on GitHub