BackendHTTP APIEnvironments

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 an environment uuid. 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.

Response example

Example Response
{
  "data": {
    "id": 123,
    "uuid": "123e4567-e89b-12d3-a456-426614174000",
    "name": "staging"
  }
}
POST
/environments

Create a new environment

Authorization

bearerAuth
headerAuthorizationBearer <token>

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

Request Body

application/json
  1. body
name*string

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

Match^[a-z0-9_-]+$
Lengthlength <= 255
is_production?boolean

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

callback_url?string

Custom OAuth callback URL for this environment.

Formaturi
hmac_key?string

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

Lengthlength <= 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?array<>

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

Itemsitems <= 100

Response Body

Successfully created an environment

application/json
  1. response
data*
Example Request
curl -X POST 'https://api.tenklo.dev/environments' \  -H 'Content-Type: application/json' \  -d '{  "name": "string"}'
Example Response
{  "data": {    "id": 0,    "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",    "name": "string"  }}