BackendHTTP APIEnvironments

Create an environment API key

Requires an Account API key with the account:environments:api_keys:create scope. Create one from Account API keys in the dashboard.

Creates an Environment API key with custom scopes. Not specifying any scopes defaults to full environment access.

environmentUuid is the UUID returned when the environment was created.

Response example

Example Response
{
  "data": {
    "id": 456,
    "uuid": "123e4567-e89b-12d3-a456-426614174001",
    "display_name": "provisioned-ci",
    "scopes": ["environment:*"],
    "secret": "<YOUR-ENVIRONMENT-API-KEY>",
    "created_at": "2026-08-18T12:00:00.000Z"
  }
}
POST
/environments/{environmentUuid}/api-keys

Create a new environment API key

Authorization

bearerAuth
headerAuthorizationBearer <token>

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

Path Parameters

environmentUuid*string

Environment UUID that will own the key.

Formatuuid

Request Body

application/json
  1. body
display_name*string

Display name for the key. Must be unique within the environment.

Length1 <= length <= 255
scopes?array<string>

Environment scopes to grant the key, such as environment:deploy or environment:*. Defaults to environment:* (full access).

Items1 <= items

Response Body

Successfully created an Environment API key

application/json
  1. response
data*
Example Request
curl -X POST 'https://api.tenklo.dev/environments/123e4567-e89b-12d3-a456-426614174000/api-keys' \  -H 'Content-Type: application/json' \  -d '{  "display_name": "string"}'
Example Response
{  "data": {    "id": 0,    "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",    "display_name": "string",    "scopes": [      "string"    ],    "secret": "string",    "created_at": "2019-08-24T14:15:22Z"  }}