Admin API¶
ReferenceFacts to look up.
Everything the console does is an Admin API call on the console port under /api/v1/. The
description is published by every instance at /api/v1/openapi.json (OpenAPI 3.1) and is
checked in with the code, so it cannot drift.
Authentication¶
Sign in for a bearer token, or use the console's cookie session with the CSRF header:
TOKEN=$(curl -s -X POST localhost:9000/api/v1/auth/login \
-H 'Content-Type: application/json' \
-d '{"email":"admin@example.com","password":"…"}' | jq -r .token)
curl -s -H "Authorization: Bearer $TOKEN" localhost:9000/api/v1/apis
Roles apply: viewers read, editors change configuration, administrators manage users, security,
sign-in, inspector settings and flow hooks. In Apinx Cloud an editor also starts and stops the
two-minute trace window (PUT /settings/inspector with only tracing); a window with request
bodies stays an administrator's.
The command-line client¶
apinxctl wraps the API for scripts and CI:
export APINX_TOKEN=$(APINX_PASSWORD='…' apinxctl login --email admin@example.com)
apinxctl get apis
apinxctl export > gateway.yaml
apinxctl import gateway.yaml && apinxctl diff && apinxctl publish -m "from file"
apinxctl rollback 1
Areas¶
| Area | Operations |
|---|---|
| Set-up and sessions | /setup, /auth/login, /auth/logout, /auth/me, /auth/password, /auth/profile |
| Draft and deployments | /draft, /draft/diff, /revisions, /deployments, /apis/{id}/revisions, /environment/revisions |
| APIs and operations | /apis, /apis/{id}/routes, /apis/{id}/effective-policies, /apis/{id}/definition, /apis/{id}/versions, /apis/{id}/lifecycle, /apis/{id}/catch-all-paths |
| Listeners, upstreams, shared flows, flow hooks | /listeners, /upstreams, /shared-flows, /environment/flow-hooks |
| Policies | /policies (catalogue), /policies/bindings/{global\|environment}, /policies/preview |
| Products and consumers | /products, /applications, /applications/{id}/keys, /applications/{id}/subscriptions, /subscriptions/{id}/… |
| Observability | /traffic, /analytics/series, /analytics/top, /system/gateway, /system/info |
| Administration | /users, /security/keys, /settings/sign-in, /settings/inspector, /audit, /export, /import, /errors |
| Console assistant | /assistant/status, /assistant/conversations, /assistant/conversations/{id}, /assistant/conversations/{id}/messages, /assistant/apis/{id}/findings, /assistant/settings |
The console assistant¶
The assistant is reached with the console session or a bearer token, never with a gateway API key, and acts as the person asking:
GET /assistant/status: whether it is available here and why not (disabled,no_key,not_in_plan,switched_off), the model, the questions allowed per hour and, in Apinx Cloud, the token balance.POST /assistant/conversationsstarts a chat;GET /assistant/conversationslists your own in this environment, newest first, each titled by its first question;GET /assistant/conversations/{id}returns one with its messages andDELETEremoves it.POST /assistant/conversations/{id}/messagesasks a question with the screen's context ({"question": "…", "context": {…}}, or{"continue": true}after a top-up). The answer streams back as server-sent events:textpieces,toolwhile it looks something up, thendone(with the balance in Apinx Cloud),refusedorerrorwith acodesuch asrate_limited,out_of_tokens,busyormisconfigured. The context is limited to 8 KB.GET /assistant/apis/{id}/findings: what the API's configuration shows that is worth a look, worked out without the model and without tokens.GETandPUT /assistant/settings(administrators, on premises only): on or off, models, the Claude API address, the monthly token cap and the write-onlyapi_key.PUTreplaces the settings as a whole: an empty model or address goes back toapinx.yaml's value, and an emptyapi_keykeeps the stored key.
Every role may ask; asking changes nothing in the configuration.
Conventions¶
- JSON in and out; unknown fields are refused with 400.
- Errors use the uniform body with an
APX-code, message, remediation and correlation id. - Identifiers are random 128-bit values; unknown ones answer 404 on every object type.
- Bodies over 4 MiB are refused.
- The description at
/api/v1/openapi.jsonis the contract; the OWASP abuse suite in CI reads it to cover every operation automatically.