Skip to main content
PUT
/
v1
/
environments
/
{environmentId}
PHP
declare(strict_types=1);

require 'vendor/autoload.php';

use novu;
use novu\Models\Components;

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

$updateEnvironmentRequestDto = new Components\UpdateEnvironmentRequestDto();

$response = $sdk->environments->update(
    environmentId: '<id>',
    updateEnvironmentRequestDto: $updateEnvironmentRequestDto

);

if ($response->environmentResponseDto !== 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

Path Parameters

environmentId
string
required

The unique identifier of the environment

Body

application/json
name
string
identifier
string
parentId
string
color
string
dns
object
bridge
object

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"