Skip to main content
GET
/
v1
/
environments
PHP
declare(strict_types=1);

require 'vendor/autoload.php';

use novu;

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



$response = $sdk->environments->list(

);

if ($response->environmentResponseDtos !== null) {
    // handle response
}
[
  {
    "_id": "60d5ecb8b3b3a30015f3e1a1",
    "name": "Production Environment",
    "_organizationId": "60d5ecb8b3b3a30015f3e1a2",
    "identifier": "prod-env-01",
    "type": "prod",
    "apiKeys": [
      {
        "key": "sk_test_1234567890abcdef",
        "_userId": "60d5ecb8b3b3a30015f3e1a4",
        "hash": "hash_value_here"
      }
    ],
    "_parentId": "60d5ecb8b3b3a30015f3e1a3",
    "slug": "production"
  }
]

Authorizations

Authorization
string
header
required

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

Headers

idempotency-key
string

A header for idempotency purposes

Response

OK

_id
string
required

Unique identifier of the environment

Example:

"60d5ecb8b3b3a30015f3e1a1"

name
string
required

Name of the environment

Example:

"Production Environment"

_organizationId
string
required

Organization ID associated with the environment

Example:

"60d5ecb8b3b3a30015f3e1a2"

identifier
string
required

Unique identifier for the environment

Example:

"prod-env-01"

type
enum<string> | null

Type of the environment

Available options:
dev,
prod
Example:

"prod"

apiKeys
object[]

List of API keys associated with the environment

_parentId
string

Parent environment ID

Example:

"60d5ecb8b3b3a30015f3e1a3"

slug
string

URL-friendly slug for the environment

Example:

"production"