Skip to main content
GET
/
v2
/
contexts
PHP
declare(strict_types=1);

require 'vendor/autoload.php';

use novu;
use novu\Models\Operations;

$sdk = novu\Novu::builder()
    ->setSecurity(
        'YOUR_SECRET_KEY_HERE'
    )
    ->build();

$request = new Operations\ContextsControllerListContextsRequest(
    limit: 10,
    id: 'tenant-prod-123',
    search: 'tenant',
);

$response = $sdk->contexts->list(
    request: $request
);

if ($response->listContextsResponseDto !== null) {
    // handle response
}
{
  "data": [
    {
      "type": "<string>",
      "id": "<string>",
      "data": {},
      "createdAt": "<string>",
      "updatedAt": "<string>"
    }
  ],
  "next": "<string>",
  "previous": "<string>",
  "totalCount": 123,
  "totalCountCapped": true
}

Authorizations

Authorization
string
header
required

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

Headers

idempotency-key
string

A header for idempotency purposes

Query Parameters

after
string

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

before
string

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

limit
number

Limit the number of items to return

orderDirection
enum<string>

Direction of sorting

Available options:
ASC,
DESC
orderBy
string

Field to order by

includeCursor
boolean

Include cursor item in response

id
string

Filter contexts by id

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

Response

OK

data
object[]
required

List of returned Contexts

next
string | null
required

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

previous
string | null
required

The cursor for the previous page of results, or null if this is the first page.

totalCount
number
required

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

totalCountCapped
boolean
required

Whether there are more than 50,000 results available