## Plotter API curl examples

Base URL (local):

- `http://localhost:3001/api`

Auth:

- If auth is enabled, add `Authorization: Bearer <TOKEN>`
- For local demo you can set `PLOTTER_AUTH_DISABLED=1`

### Health

```bash
curl -sS http://localhost:3001/api/plotter/health
```

### Single command

```bash
curl -sS -X POST http://localhost:3001/api/plotter/command \
  -H "Content-Type: application/json" \
  -d '{"command":"PENUP","timeoutMs":4000}'
```

### Job from inline script

```bash
curl -sS -X POST http://localhost:3001/api/plotter/job \
  -H "Content-Type: application/json" \
  -d '{"script":"PENUP\nSPEED 1200\nMOVE X200 Y200\nPENUP","timeoutMs":4000,"stopOnError":true}'
```

### Job from a script file

```bash
curl -sS -X POST http://localhost:3001/api/plotter/job \
  -H "Content-Type: application/json" \
  --data-binary @<(python3 - <<'PY'
import json, pathlib
script = pathlib.Path("docs/plotter/examples/job-script.txt").read_text(encoding="utf-8")
print(json.dumps({"script": script, "timeoutMs": 4000, "stopOnError": True}))
PY
) \
  -H "Content-Type: application/json"
```

