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

require 'vendor/autoload.php';

use novu;

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



$response = $sdk->contexts->retrieve(
    id: '<id>',
    type: '<value>'

);

if ($response->getContextResponseDto !== null) {
    // handle response
}
{
  "type": "<string>",
  "id": "<string>",
  "data": {},
  "createdAt": "<string>",
  "updatedAt": "<string>"
}

Authorizations

Authorization
string
header
required

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

Headers

idempotency-key
string

A header for idempotency purposes

Path Parameters

id
string
required

Context ID

type
string
required

Context type

Response

OK

type
string
required

Context type (e.g., tenant, app, workspace)

id
string
required

Unique identifier for this context

data
object
required

Custom data associated with this context

createdAt
string
required

Creation timestamp

updatedAt
string
required

Last update timestamp