# Run a drill (machine)

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

`POST /v1/admin/drills`

`agents:freeze`. At most one an hour per workspace (`drill_cooldown`).

## 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/drills" \
  -H "authorization: Bearer $IMMISCIBLE_SERVICE_TOKEN" \
  -H "content-type: application/json" \
  -d '{
    "selector": {
      "tier": "senior"
    }
  }'
```

Node:

```ts
const res = await fetch('https://immiscible.fly.dev/v1/admin/drills', {
  method: 'POST',
  headers: {
    authorization: `Bearer ${process.env.IMMISCIBLE_SERVICE_TOKEN}`,
    'content-type': 'application/json',
  },
  body: JSON.stringify({
    selector: {
      tier: 'senior',
    },
  }),
});
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/drills",
    headers={
        "authorization": f"Bearer {os.environ['IMMISCIBLE_SERVICE_TOKEN']}",
        "content-type": "application/json",
    },
    json={
        "selector": {
            "tier": "senior",
        },
    },
)
print(res.status_code, res.json())
```
