# archive_environment

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

Archive an environment. Until it is restored it leaves environment lists, cannot change, its deployments cannot be added, changed or removed, and vault pulls for it are refused. Archiving an archived environment changes nothing. Returns the environment. Needs write access.

- Area: Catalog
- Needs the write grant. Destructive. Idempotent.

## Inputs

- `environment` (string, required): The environment's slug, such as staging.

## Request

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "archive_environment",
    "arguments": {
      "environment": "staging"
    }
  }
}
```

## 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:archive \
  -H "Authorization: Bearer $CLANKER_AGENT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "environment": "staging"
  }'
```
