Agents: request Accept: text/markdown or append /index.md.
# SliceRun HTTP API
Base URL: https://slicerun.pages.dev
Authenticate with `Authorization: Bearer <token>` from the OAuth token endpoint, or the `sr_session` cookie from the web app. Unauthenticated calls to protected routes return `401` with a `WWW-Authenticate` header pointing at RFC 9728 metadata.
## Privacy
`GET /api/jobs/{id}` returns:
- `visibility: full` for the posting shop, assigned courier, and admin
- `visibility: preview` for a candidate courier (pickup, fee, ready time — no drop-off or notes)
- `404` for everyone else, including a courier who was offered a job that someone else accepted
## Useful endpoints
- `GET /api/health` — public liveness
- `POST /api/jobs` — shop or broker posts a run or a freight load. Auto-approve is one heuristic and starts on. Optional `autoApprove: false` only sets that run's initial switch.
- `POST /api/jobs/{id}/auto-approve` — the poster turns that same switch on or off while the run is still unclaimed. It locks once a courier is assigned.
- `GET /api/shop/jobs` / `GET /api/driver/jobs` — role-scoped lists
- `POST /api/jobs/{id}/accept|pickup|deliver|cancel` — accept assigns the run, or sends a request when auto-approve is off. Cancel is refused after pickup
- `POST /api/jobs/{id}/requests/{requestId}/approve` and `/decline` — poster decides a request
- `POST /api/jobs/{id}/emergency-cancel` — assigned courier, vehicle or health note, shop is notified
- `GET /api/verification` — own status only
- `POST /oauth/register` / `GET /oauth/authorize` / `POST /oauth/token`
Full machine description: https://slicerun.pages.dev/openapi.json