List all environments

This API returns a list of environments for the current organization. Each environment contains its configuration, API keys (if user has access), and metadata.

GET
/v1/environments

Authorization

Authorization<token>

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

In: header

Header Parameters

idempotency-keystring

A header for idempotency purposes

Response Body

OK

responseRequiredarray<object>
export type Response = EnvironmentResponseDto[];
 
export interface EnvironmentResponseDto {
  /**
   * 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;
  /**
   * 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 GET "https://api.novu.co/v1/environments" \
  -H "idempotency-key: string" \
  -H "Authorization: <token>"
[
  {
    "_id": "60d5ecb8b3b3a30015f3e1a1",
    "name": "Production Environment",
    "_organizationId": "60d5ecb8b3b3a30015f3e1a2",
    "identifier": "prod-env-01",
    "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