Docs
/
/

Environments Management API reference

Complete reference documentation for the Environments resource.

Environments

#

Knock uses the concept of environments to ensure logical separation of your data. Dashboard resources are created in your development environment and promoted to higher environments.

List environments

#

Returns a paginated list of environments. The environments will be returned in order of their index, with the development environment first.

Endpoint

GET/v1/environments

Query parameters

after
string

The cursor to fetch entries after.

before
string

The cursor to fetch entries before.

limit
integer

The number of entries to fetch per-page.

Returns

PaginatedEnvironmentResponse

A paginated list of Environment. Contains a list of entries and page information.

A list of entries.

created_at
string(date-time)
Required

The timestamp of when the environment was created.

deleted_at
string(date-time)

The timestamp of when the environment was deleted.

hide_pii_data
boolean

Whether PII data is hidden from the environment. Read more in the data obfuscation docs.

label_color
string

The color of the environment label to display in the dashboard.

last_commit_at
string(date-time)

The timestamp of the most-recent commit in the environment.

name
string
Required

A human-readable name for the environment. Cannot exceed 255 characters.

order
integer
Required

The order of the environment. The lowest number is the first environment, the highest number is the last environment. The order will not always be sequential.

owner
enum(string)
Required

The owner of the environment.

systemuser
slug
string
Required

A unique slug for the environment. Cannot exceed 255 characters.

updated_at
string(date-time)
Required

The timestamp of when the environment was last updated.

page_info

The information about a paginated result.

after
string

The cursor to fetch entries after. Will only be present if there are more entries to fetch.

before
string

The cursor to fetch entries before. Will only be present if there are more entries to fetch before the current page.

page_size
integer

The number of entries to fetch per-page.

Get an environment

#

Returns a single environment by the environment_slug.

Endpoint

GET/v1/environments/{environment_slug}

Path parameters

environment_slug
string

The slug of the environment to retrieve.

Returns

An environment object.

created_at
string(date-time)

The timestamp of when the environment was created.

deleted_at
string(date-time)

The timestamp of when the environment was deleted.

hide_pii_data
boolean

Whether PII data is hidden from the environment. Read more in the data obfuscation docs.

label_color
string

The color of the environment label to display in the dashboard.

last_commit_at
string(date-time)

The timestamp of the most-recent commit in the environment.

name
string

A human-readable name for the environment. Cannot exceed 255 characters.

order
integer

The order of the environment. The lowest number is the first environment, the highest number is the last environment. The order will not always be sequential.

owner
enum(string)

The owner of the environment.

systemuser
slug
string

A unique slug for the environment. Cannot exceed 255 characters.

updated_at
string(date-time)

The timestamp of when the environment was last updated.

Environment

#

An environment object.

Attributes

created_at
string(date-time)

The timestamp of when the environment was created.

deleted_at
string(date-time)

The timestamp of when the environment was deleted.

hide_pii_data
boolean

Whether PII data is hidden from the environment. Read more in the data obfuscation docs.

label_color
string

The color of the environment label to display in the dashboard.

last_commit_at
string(date-time)

The timestamp of the most-recent commit in the environment.

name
string

A human-readable name for the environment. Cannot exceed 255 characters.

order
integer

The order of the environment. The lowest number is the first environment, the highest number is the last environment. The order will not always be sequential.

owner
enum(string)

The owner of the environment.

systemuser
slug
string

A unique slug for the environment. Cannot exceed 255 characters.

updated_at
string(date-time)

The timestamp of when the environment was last updated.

New chat