Skip to main content
POST
Requires an Account API key with the account:environments:create scope. Create one from Account API keys in the dashboard.
Creates a new environment. Additional environments are limited by your pricing plan. Set is_production: true to create a production environment. This also requires account:environments:set_production. The reserved name prod is always production and cannot be combined with is_production: false. Pass webhooks to configure URLs and subscriptions. Nango generates a webhook signing key for the new environment. See Receive webhooks from Nango for delivery behavior, event types, and signature verification. The response returns the complete environment settings, including the plaintext webhook signing key and environment uuid. Use the uuid to create an Environment API key or delete the environment. Creating an environment also creates a default full-access Environment API key, but the secret is not returned.

Authorizations

Authorization
string
header
required

An Environment API key from your Nango environment, or an Account API key for account-level endpoints.

Body

application/json
name
string
required

Environment name. Lowercase letters, digits, hyphens, and underscores only. Max 255 characters. The reserved name prod is always treated as production.

Maximum string length: 255
Pattern: ^[a-z0-9_-]+$
Example:

"staging"

is_production
boolean

Whether to mark the environment as production. Defaults to false, except for the reserved name prod.

callback_url
string<uri>

Custom OAuth callback URL for this environment.

hmac_key
string
deprecated

Legacy public-key authorization HMAC key. Use Connect sessions instead.

Maximum string length: 1000
hmac_enabled
boolean
deprecated

Whether legacy public-key authorization HMAC verification is enabled. Use Connect sessions instead.

slack_notifications
boolean

Whether Slack notifications are enabled for this environment.

otlp_endpoint
string

OpenTelemetry collector endpoint. Requires a plan with OpenTelemetry export. Pass an empty string to set an empty endpoint.

otlp_headers
object[]

Headers sent with OpenTelemetry export requests. Requires a plan with OpenTelemetry export. Maximum 100 headers.

Maximum array length: 100
webhooks
object

Initial webhook settings. Omitted URLs default to null; omitted subscription flags default to true.

Response

Successfully created an environment

data
object
required