# Freeze agents in bulk (machine)

Source: https://immiscible.fly.dev/docs/api/post-v1-admin-freeze

`POST /v1/admin/freeze`

`agents:freeze`. A selector, a reason, and `dryRun` then `confirmCount`. See [freeze a fleet](https://immiscible.fly.dev/docs/guides/kill-switch.md#freeze-a-fleet).

## Authentication

Service token. A scoped machine token (`ims_...`) made by an owner or admin under Settings, sent as `Authorization: Bearer`. Each route needs one scope; tokens expire within 90 days and can be pinned to address ranges. A token can stop agents but never start them, and never decides an approval.

## Request

curl:

```bash
curl -X POST "https://immiscible.fly.dev/v1/admin/freeze" \
  -H "authorization: Bearer $IMMISCIBLE_SERVICE_TOKEN" \
  -H "content-type: application/json" \
  -d '{
    "selector": {
      "upstreamId": "mcu_6c1d0e"
    },
    "reason": "compromised tool server",
    "hold": "incident",
    "confirmCount": 40
  }'
```

Node:

```ts
const res = await fetch('https://immiscible.fly.dev/v1/admin/freeze', {
  method: 'POST',
  headers: {
    authorization: `Bearer ${process.env.IMMISCIBLE_SERVICE_TOKEN}`,
    'content-type': 'application/json',
  },
  body: JSON.stringify({
    selector: {
      upstreamId: 'mcu_6c1d0e',
    },
    reason: 'compromised tool server',
    hold: 'incident',
    confirmCount: 40,
  }),
});
const data = await res.json();
console.log(res.status, data);
```

Python:

```python
import os
import requests

res = requests.post(
    "https://immiscible.fly.dev/v1/admin/freeze",
    headers={
        "authorization": f"Bearer {os.environ['IMMISCIBLE_SERVICE_TOKEN']}",
        "content-type": "application/json",
    },
    json={
        "selector": {
            "upstreamId": "mcu_6c1d0e",
        },
        "reason": "compromised tool server",
        "hold": "incident",
        "confirmCount": 40,
    },
)
print(res.status_code, res.json())
```
