# Units: Commands & API

> Driving units from outside the editor.

Glider documentation · Logic · Web page: https://cgglider.com/docs/units/commands/

Sections of this page: [Overview](https://cgglider.com/docs/units.md) · [Clock](https://cgglider.com/docs/units/clock.md) · [Counter](https://cgglider.com/docs/units/counter.md) · [Ticker](https://cgglider.com/docs/units/ticker.md) · [Formatter](https://cgglider.com/docs/units/formatter.md) · [Watch rule](https://cgglider.com/docs/units/watch-rule.md) · [Data feed](https://cgglider.com/docs/units/poller.md) · [Runtime & gating](https://cgglider.com/docs/units/runtime.md) · [Commands & API](https://cgglider.com/docs/units/commands.md)

Every unit action goes through one endpoint: POST /api/pages/<id>/units/command. The route holds no logic — it parses the body, validates the envelope, hands it to the port and maps the result to a status code. What a command means lives in the domain and application layers.

```bash
curl -X POST http://localhost:4004/api/pages/<pageId>/units/command \
  -H "Content-Type: application/json" \
  -d '{"type":"counter","unitId":"<unitId>","action":"increment"}'
```

- An unknown action is rejected with the list of known actions for that kind — “clock has no action "go". Known: start, pause, stop, …”.
- unitId addresses a stored unit; the request object fully describes the command, with no hidden editor state.
- The same gate backs buttons, Stream Deck keys, reactions and the MCP tools, so behaviour is identical whoever fires it.

A poller can also be probed on its own: POST /api/pages/<id>/runtime/units/<unitId>/probe.
