Skip to content

Update a variable

Updates an existing environment variable. Providing values replaces all existing per-environment values.

PATCH
/v1/environment-variables/{variableId}

Authorization

Authorization<token>

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

In: header

Request Body

application/jsonRequired
keystring

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

Maximum length: 256Pattern: "/^[A-Za-z][A-Za-z0-9_]*$/"
typestring

The type of the variable

Value in: "string"
isSecretboolean
valuesarray<object>

Path Parameters

variableIdRequiredstring

Header Parameters

idempotency-keystring

A header for idempotency purposes

Response Body

OK

_idRequiredstring
_organizationIdRequiredstring
keyRequiredstring
typeRequiredstring
Value in: "string"
isSecretRequiredboolean
valuesRequiredarray<object>
createdAtRequiredstring
updatedAtRequiredstring
export interface Response {
  _id: string;
  _organizationId: string;
  key: string;
  type: "string";
  isSecret: boolean;
  values: EnvironmentVariableValueResponseDto[];
  createdAt: string;
  updatedAt: string;
}
export interface EnvironmentVariableValueResponseDto {
  _environmentId: string;
  /**
   * Value is masked (••••••••) for secret variables
   */
  value: string;
}
 
curl -X PATCH "https://api.novu.co/v1/environment-variables/string" \
  -H "idempotency-key: string" \
  -H "Authorization: <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "key": "string",
    "type": "string",
    "isSecret": true,
    "values": [
      {
        "_environmentId": "string",
        "value": "string"
      }
    ]
  }'
{
  "_id": "string",
  "_organizationId": "string",
  "key": "string",
  "type": "string",
  "isSecret": true,
  "values": [
    {
      "_environmentId": "string",
      "value": "string"
    }
  ],
  "createdAt": "string",
  "updatedAt": "string"
}

On this page

No Headings
Edit this page on GitHub