Update an environment

Update an environment by its unique identifier **environmentId**. You can modify the environment name, identifier, color, and other configuration settings.

Update an environment by its unique identifier environmentId. You can modify the environment name, identifier, color, and other configuration settings.

PUT
/v1/environments/{environmentId}

Authorization

Authorization<token>

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

In: header

Request Body

application/jsonRequired
namestring
identifierstring
parentIdstring
colorstring
dnsobject
bridgeobject

Path Parameters

environmentIdRequiredstring

The unique identifier of the environment

Header Parameters

idempotency-keystring

A header for idempotency purposes

Response Body

OK

_idRequiredstring

Unique identifier of the environment

nameRequiredstring

Name of the environment

_organizationIdRequiredstring

Organization ID associated with the environment

identifierRequiredstring

Unique identifier for the environment

typestring | null

Type of the environment

Value in: "dev" | "prod"
apiKeysarray<object>

List of API keys associated with the environment

_parentIdstring

Parent environment ID

slugstring

URL-friendly slug for the environment

export interface Response {
  /**
   * Unique identifier of the environment
   */
  _id: string;
  /**
   * Name of the environment
   */
  name: string;
  /**
   * Organization ID associated with the environment
   */
  _organizationId: string;
  /**
   * Unique identifier for the environment
   */
  identifier: string;
  /**
   * Type of the environment
   */
  type?: ("dev" | "prod") | null;
  /**
   * List of API keys associated with the environment
   */
  apiKeys?: ApiKeyDto[];
  /**
   * Parent environment ID
   */
  _parentId?: string;
  /**
   * URL-friendly slug for the environment
   */
  slug?: string;
}
export interface ApiKeyDto {
  /**
   * API key
   */
  key: string;
  /**
   * User ID associated with the API key
   */
  _userId: string;
  /**
   * Hashed representation of the API key
   */
  hash?: string;
}
 
curl -X PUT "https://api.novu.co/v1/environments/string" \
  -H "idempotency-key: string" \
  -H "Authorization: <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "string",
    "identifier": "string",
    "parentId": "string",
    "color": "string",
    "dns": {
      "inboundParseDomain": "string"
    },
    "bridge": {
      "url": "string"
    }
  }'
{
  "_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"
}

On this page

No Headings
Edit this page on GitHub