Environments mAPI reference
Complete reference documentation for the Environments resource.
Environments
#Knock uses the concept of environments to ensure logical separation of your data. Your account starts with a single production environment. If you've enabled environments, you can create resources in your development environment and promote them to higher environments.
List environments
#Returns a paginated list of visible environments in catalog order.
Endpoint
Query parameters
The cursor to fetch entries after.
The cursor to fetch entries before.
The number of entries to fetch per-page.
Returns
A paginated list of Environment. Contains a list of entries and page information.
A list of entries.
The timestamp of when the environment was created.
The timestamp of when the environment was deleted.
Whether PII data is hidden from the environment. Read more in the data obfuscation docs.
The color of the environment label to display in the dashboard.
The timestamp of the most-recent commit in the environment.
A human-readable name for the environment. Cannot exceed 255 characters.
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.
The owner of the environment.
A unique slug for the environment. Cannot exceed 255 characters.
The timestamp of when the environment was last updated.
Whether the environment is part of the account catalog.
The information about a paginated result.
The cursor to fetch entries after. Will only be present if there are more entries to fetch.
The cursor to fetch entries before. Will only be present if there are more entries to fetch before the current page.
The number of entries to fetch per-page.
Get an environment
#Returns a single environment by the environment_slug.
Endpoint
Path parameters
The slug of the environment to retrieve.
Returns
An environment object.
The timestamp of when the environment was created.
The timestamp of when the environment was deleted.
Whether PII data is hidden from the environment. Read more in the data obfuscation docs.
The color of the environment label to display in the dashboard.
The timestamp of the most-recent commit in the environment.
A human-readable name for the environment. Cannot exceed 255 characters.
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.
The owner of the environment.
A unique slug for the environment. Cannot exceed 255 characters.
The timestamp of when the environment was last updated.
Whether the environment is part of the account catalog.
Preference defaults
#Get environment defaults
#Returns the default settings for an environment. When no defaults have been set, preference_set and both timestamps are null.
Endpoint
Path parameters
The slug of the environment to read or update the defaults for.
Returns
The default settings for an environment.
The timestamp of when the defaults were first set. Null when no defaults have been set.
A preference set applied to every recipient in the environment unless the recipient overrides it. The __persistence_strategy__ and __strategy__ keys are not supported, because defaults are always replaced in full.
A map of category key to a boolean or an object containing channel_types, channels, and conditions.
A map of channel type to a boolean or an object containing conditions. Valid channel types are email, sms, push, chat, in_app_feed, and http.
A map of channel ID to a boolean or an object containing conditions.
Whether the recipient is subscribed to commercial messages, as a boolean or a settings object.
A map of workflow key to a boolean or an object containing channel_types, channels, and conditions.
The timestamp of when the defaults were last updated. Null when no defaults have been set.
Upsert environment defaults
#Creates or replaces the default settings for an environment. The change applies to the environment immediately, including production. It is not committed or promoted, and concurrent writes are last-write-wins. The preference_set replaces any existing set in full, and null clears it.
Endpoint
Path parameters
The slug of the environment to read or update the defaults for.
Request body
A preference set applied to every recipient in the environment unless the recipient overrides it. The __persistence_strategy__ and __strategy__ keys are not supported, because defaults are always replaced in full.
A map of category key to a boolean or an object containing channel_types, channels, and conditions.
A map of channel type to a boolean or an object containing conditions. Valid channel types are email, sms, push, chat, in_app_feed, and http.
A map of channel ID to a boolean or an object containing conditions.
Whether the recipient is subscribed to commercial messages, as a boolean or a settings object.
A map of workflow key to a boolean or an object containing channel_types, channels, and conditions.
Returns
The default settings for an environment.
The timestamp of when the defaults were first set. Null when no defaults have been set.
A preference set applied to every recipient in the environment unless the recipient overrides it. The __persistence_strategy__ and __strategy__ keys are not supported, because defaults are always replaced in full.
A map of category key to a boolean or an object containing channel_types, channels, and conditions.
A map of channel type to a boolean or an object containing conditions. Valid channel types are email, sms, push, chat, in_app_feed, and http.
A map of channel ID to a boolean or an object containing conditions.
Whether the recipient is subscribed to commercial messages, as a boolean or a settings object.
A map of workflow key to a boolean or an object containing channel_types, channels, and conditions.
The timestamp of when the defaults were last updated. Null when no defaults have been set.
EnvironmentDefaultsPreferenceSet
#A preference set applied to every recipient in the environment unless the recipient overrides it. The __persistence_strategy__ and __strategy__ keys are not supported, because defaults are always replaced in full.
Attributes
A map of category key to a boolean or an object containing channel_types, channels, and conditions.
A map of channel type to a boolean or an object containing conditions. Valid channel types are email, sms, push, chat, in_app_feed, and http.
A map of channel ID to a boolean or an object containing conditions.
Whether the recipient is subscribed to commercial messages, as a boolean or a settings object.
A map of workflow key to a boolean or an object containing channel_types, channels, and conditions.
EnvironmentDefaults
#The default settings for an environment.
Attributes
The timestamp of when the defaults were first set. Null when no defaults have been set.
A preference set applied to every recipient in the environment unless the recipient overrides it. The __persistence_strategy__ and __strategy__ keys are not supported, because defaults are always replaced in full.
A map of category key to a boolean or an object containing channel_types, channels, and conditions.
A map of channel type to a boolean or an object containing conditions. Valid channel types are email, sms, push, chat, in_app_feed, and http.
A map of channel ID to a boolean or an object containing conditions.
Whether the recipient is subscribed to commercial messages, as a boolean or a settings object.
A map of workflow key to a boolean or an object containing channel_types, channels, and conditions.
The timestamp of when the defaults were last updated. Null when no defaults have been set.
Environment
#An environment object.
Attributes
The timestamp of when the environment was created.
The timestamp of when the environment was deleted.
Whether PII data is hidden from the environment. Read more in the data obfuscation docs.
The color of the environment label to display in the dashboard.
The timestamp of the most-recent commit in the environment.
A human-readable name for the environment. Cannot exceed 255 characters.
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.
The owner of the environment.
A unique slug for the environment. Cannot exceed 255 characters.
The timestamp of when the environment was last updated.
Whether the environment is part of the account catalog.