Skip to main content
POST
Create an environment
Requires an Account API key. Create one from Account API keys in the dashboard.
Creates a new environment. Additional environments are limited by your pricing plan. You can create a production environment by setting is_production: true. The response includes the numeric environment id. Use it 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

HMAC key used by the legacy public-key authorization flow.

Maximum string length: 1000
hmac_enabled
boolean

Whether HMAC verification is enabled for the legacy public-key authorization flow.

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

Response

Successfully created an environment

data
object
required