Skip to main content
PATCH
/
v1
/
environment-variables
/
{variableKey}
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();

$updateEnvironmentVariableRequestDto = new Components\UpdateEnvironmentVariableRequestDto();

$response = $sdk->environmentVariables->update(
    variableKey: 'BASE_URL',
    updateEnvironmentVariableRequestDto: $updateEnvironmentVariableRequestDto

);

if ($response->environmentVariableResponseDto !== null) {
    // handle response
}
{
  "_id": "<string>",
  "_organizationId": "<string>",
  "key": "<string>",
  "type": "string",
  "isSecret": true,
  "values": [
    {
      "_environmentId": "<string>",
      "value": "<string>"
    }
  ],
  "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

variableKey
string
required

The unique key of the environment variable (e.g. BASE_URL)

Body

application/json
key
string

Unique key for the variable. Must start with a letter and contain only letters, digits, and underscores.

Maximum string length: 256
Pattern: /^[A-Za-z][A-Za-z0-9_]*$/
type
enum<string>

The type of the variable

Available options:
string
isSecret
boolean
values
object[]

Response

OK

_id
string
required
_organizationId
string
required
key
string
required
type
enum<string>
required
Available options:
string
isSecret
boolean
required
values
object[]
required
createdAt
string
required
updatedAt
string
required