automaintainer/ docs
Dashboard →

API reference

The panel exposes a JSON API used by the dashboard. All routes require an authenticated session (cookie) or a bearer token; all data is scoped to your account.

Repos

Method Path Purpose
GET /api/repos List your repos
POST /api/repos Add a repo
GET /api/repos/{id} Repo detail
PATCH /api/repos/{id} Update settings (focus, verify_cmd, team, schedule, explore…)
POST /api/repos/{id}/run Trigger a run
GET /api/repos/{id}/runs Recent runs for the repo

Explore mode

Method Path Purpose
POST /api/repos/{id}/explore Kick a read‑only scout (Pro+)
GET /api/repos/{id}/candidates Proposed candidates
GET /api/repos/{id}/explore-stats Campaign counts (proposed/selected/rejected/done)
POST /api/candidates/{id}/run Apply a candidate's focus+gate and run it
POST /api/candidates/{id}/reject Dismiss a candidate

Runs

Method Path Purpose
GET /api/runs List runs
GET /api/runs/{id} Run detail
GET /api/runs/{id}/bus Live agent bus for the run
POST /api/runs/{id}/pr Recover a PR for a pushed run

Workers

Method Path Purpose
GET /api/worker/status Connected workers + health/probes
GET /api/worker/models?cli=… Models available on a worker
POST /api/worker/probe On‑demand reachability test of a {cli, model}
PATCH /api/workers/{id} Enable/disable a worker

Memory

Method Path Purpose
GET /api/repos/{id}/memories List repo memories
POST /api/repos/{id}/memories Add a memory
DELETE /api/repos/{id}/memories/{mid} Delete a memory

Account

Method Path Purpose
GET /api/account Account details, plan and usage
GET /api/account/license Worker license key
POST /api/account/license?notify_workers=1 Rotate license key and, when opted in, push the new token to connected workers

License rotation

POST /api/account/license returns a new license_key. Pass a truthy notify_workers as a query parameter (?notify_workers=1) or in the JSON body ({"notify_workers": true}) to immediately push a token_rotated command to all connected workers. The response includes notified_workers (bool) and notified_workers_count (int). The broadcast is best-effort and non-blocking; offline workers, or workers whose send buffers are full at the moment of rotation, must still be updated with the new --token before reconnecting.

Accepted truthy values are case-insensitive: 1, true, t, yes, y, on. The JSON body accepts booleans, the number 1 (or any JSON representation equal to 1, such as 1.0 or 1e0), or any of the whitespace-trimmed string forms above. The query parameter takes precedence over the JSON body, so a stale body value cannot override an explicit ?notify_workers= string. Only GET and POST are allowed; other methods receive 405 Method Not Allowed with an Allow: GET, POST header.

Security note — key material. The old and new license key values are never written to panel logs or returned under any field other than license_key. The notified_workers response only reports whether any connected workers were notified and how many, never the key itself. The panel also updates each notified worker's stored AgentToken in memory so the next spawn for that worker uses the new key.

All license endpoint responses carry Cache-Control: no-store, Pragma: no-cache, and Expires: 0 headers so the key is never cached by browsers or proxies.

Example

curl -s -H "Authorization: Bearer $TOKEN" \
  -X POST "https://automaintainer.intrane.fr/api/account/license?notify_workers=1"

Or pass the opt-in as JSON so a dashboard or scripted client can keep the parameter in the request body:

curl -s -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -X POST "https://automaintainer.intrane.fr/api/account/license" \
  -d '{"notify_workers": true}'
{
  "license_key": "am_...",
  "notified_workers": true,
  "notified_workers_count": 2
}