# create_environment

`tools/call` · `POST /agent/v1/environments:create`

Create an environment: a place products run, such as staging or production. Its class says whether it holds real customer data and never changes. No other environment, archived ones included, may use the slug or name. Returns the new environment. Needs write access.

- Area: Catalog
- Needs the write grant.

## Inputs

- `slug` (string, required): The environment's slug: 2 to 48 lowercase letters, numbers or hyphens, such as staging.
- `name` (string, required): The environment's display name, up to 80 characters, such as Staging.
- `class` (string, one of: `production`, `non-production`, required): `production` for real customer data or the live system customers use; `non-production` for fake or disposable data, such as staging. It cannot change later.
- `description` (string): What the environment is for, up to 200 characters.
- `emoji` (string): An emoji shown with the name, up to 8 characters, such as 🧪.

## Request

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "create_environment",
    "arguments": {
      "slug": "staging",
      "name": "Staging",
      "class": "non-production",
      "description": "Pre-release builds with test data.",
      "emoji": "🧪"
    }
  }
}
```

## HTTP request

The same call over the agent HTTP API, with an agent OAuth access token:

```bash
curl -X POST https://api.qa.clankership.net/agent/v1/environments:create \
  -H "Authorization: Bearer $CLANKER_AGENT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "slug": "staging",
    "name": "Staging",
    "class": "non-production",
    "description": "Pre-release builds with test data.",
    "emoji": "🧪"
  }'
```
