Skip to content

Admin API

The Admin API is served by control_plane_app under the /admin/v1 prefix. It provides full management capabilities for the AuthNexus platform including agent (admin) accounts, applications, users, card keys, nodes, PKI, security, and reporting.

General Information

Base URL

http://127.0.0.1:9090/admin/v1

The admin API listens on loopback by default. In production, expose it through a reverse proxy with TLS termination.

Authentication

Most endpoints require a valid admin session token in the Authorization header:

Authorization: Bearer <access_token>

Tokens are obtained via the login endpoint and refreshed via the refresh endpoint.

Response Format

All responses use JSON. Successful responses include the resource data directly. Error responses follow a consistent structure:

json
{
    "error": "error_code",
    "message": "Human-readable description"
}

Pagination

List endpoints support pagination via query parameters:

ParameterTypeDescription
pageintegerPage number (1-based)
page_sizeintegerItems per page

Responses include pagination metadata where applicable.

Authentication Endpoints

MethodPathDescription
POST/auth/loginAuthenticate with username and password
GET/auth/meGet current agent profile
POST/auth/logoutInvalidate current session
POST/auth/refreshRefresh access token

Setup (First Run)

MethodPathDescription
GET/setup/statusCheck initialization state (PKI, root admin)
POST/setup/initializeComplete first-run setup (requires console token)

The setup endpoints are available before authentication is configured. After the root admin is created, /setup/status returns requires_setup: false with no PKI details exposed.

Applications

MethodPathDescription
GET/applicationsList all applications
POST/applicationsCreate application
PATCH/applications/:app_idUpdate application
DELETE/applications/:app_idSoft-delete (recycle bin)
POST/applications/:app_id/restoreRestore from recycle bin
POST/applications/:app_id/purgePermanently delete

Agents (Admin Accounts)

MethodPathDescription
GET/agentsList agents
POST/agentsCreate agent
PATCH/agents/:idUpdate agent
DELETE/agents/:idSoft-delete (recycle bin)
POST/agents/:id/restoreRestore from recycle bin
DELETE/agents/:id/purgePermanently delete
POST/agents/:id/moveMove agent in hierarchy
GET/agents/:id/subtreeGet agent subtree
GET/agents/:id/timelineAgent activity timeline
GET/agents/:id/statsAgent statistics
POST/agents/:id/reset-passwordReset agent password

Agent Permissions & Grants

MethodPathDescription
GET/agents/:id/permissionsGet agent permissions
PATCH/agents/:id/permissionsUpdate permissions
GET/agents/:id/app-grantsGet application grants
PUT/agents/:id/app-grantsSet application grants
GET/agents/:id/card-type-grantsGet card type grants
PUT/agents/:id/card-type-grantsSet card type grants
GET/agents/:id/card-type-pricesGet card type prices
PUT/agents/:id/card-type-pricesSet card type prices
GET/agents/:id/bindingsGet agent bindings
GET/permission-defsList permission definitions

Agent Wallet

MethodPathDescription
GET/agents/:id/walletGet wallet balance
POST/agents/:id/wallet/adjustAdjust balance
POST/wallet/transferTransfer between agents
GET/agents/:id/ledgerTransaction ledger

Agent Billing Mode

MethodPathDescription
POST/agents/:id/billing-mode/previewPreview billing mode change
POST/agents/:id/billing-mode/applyApply billing mode change

Settlement

MethodPathDescription
GET/agents/:id/commission-rulesGet commission rules
PUT/agents/:id/commission-rulesSet commission rules
DELETE/agents/:id/commission-rules/:childIdDelete rule
POST/settlement/reportGenerate settlement report

Users

MethodPathDescription
GET/usersList users (with filtering)
PATCH/users/:idUpdate user
DELETE/users/:idDelete user
GET/users/:id/timelineUser activity timeline
GET/users/:id/ledgerUser transaction ledger
POST/users/:id/recharge-by-cardRecharge by card key
POST/users/:id/reset-passwordReset password
POST/users/:id/add-timeAdd service time
GET/users/:id/bindingsUser-agent bindings
POST/agent-user-bindingsCreate binding
DELETE/agent-user-bindings/:user_idDelete binding

Batch User Operations

MethodPathDescription
POST/users/batch/activeBatch activate/deactivate
POST/users/batch/expire-atBatch set expiration
POST/users/batch/add-timeBatch add time
POST/users/batch/deleteBatch delete

Card Keys

MethodPathDescription
GET/card-keysList card keys
GET/card-key-batchesList generation batches
PATCH/card-keys/:idUpdate card key
DELETE/card-keys/:idDelete card key
POST/card-keys/generateGenerate new card keys
POST/card-keys/batch/patchBatch update
POST/card-keys/batch/deleteBatch delete

Card Types & Configuration

MethodPathDescription
GET/card-typesList card types
POST/card-typesCreate card type
PATCH/card-types/:idUpdate card type
DELETE/card-types/:idDelete card type

Cloud Functions

MethodPathDescription
GET/cloud-functionsList cloud functions
GET/cloud-functions/:nameGet function detail
POST/cloud-functionsCreate function
PUT/cloud-functions/:nameUpdate function
DELETE/cloud-functions/:nameDelete function
PATCH/cloud-functions/:name/toggleToggle enabled state

Variables

MethodPathDescription
GET/variablesList cloud variables
POST/variablesCreate variable
PATCH/variables/:idUpdate variable
DELETE/variables/:idDelete variable

Versions & Announcements

MethodPathDescription
GET/versionsList app versions
POST/versionsCreate version
PATCH/versions/:idUpdate version
DELETE/versions/:idDelete version
GET/announcementsList announcements
POST/announcementsCreate announcement
PATCH/announcements/:idUpdate announcement
POST/announcements/reorderReorder announcements
DELETE/announcements/:idDelete announcement

Nodes

MethodPathDescription
GET/nodes/overviewNode statistics overview
GET/nodesList nodes
POST/nodesCreate node (triggers PKI onboard)
GET/nodes/:nidNode detail
PUT/nodes/:nidUpdate node
POST/nodes/:nid/disableDisable node
POST/nodes/:nid/enableEnable node
DELETE/nodes/:nidHard delete node
POST/nodes/:nid/enrollment-tokenGenerate enrollment token
GET/nodes/:nid/enrollment-tokensList enrollment tokens
GET/nodes/:nid/deploy-packagesList deploy packages
POST/nodes/:nid/deploy-packagesGenerate deploy package
GET/nodes/:nid/deploy-packages/:pid/downloadDownload package
POST/nodes/:nid/reissue-packageReissue deploy package

Node Certificates

MethodPathDescription
GET/nodes/:nid/certsList node certificates
POST/nodes/:nid/certs/issueIssue certificate (async, 202)
POST/nodes/:nid/certs/:cid/revokeRevoke certificate
POST/nodes/:nid/certs/rotateRotate certificates (async, 202)

PKI

MethodPathDescription
GET/pki/casList CAs
POST/pki/casCreate CA
GET/pki/cas/:idCA detail
GET/pki/certsList all certificates
GET/pki/certs/:idCertificate detail
POST/pki/certs/:id/revokeRevoke certificate
GET/pki/jobsList PKI jobs
GET/pki/jobs/:idJob detail
POST/pki/jobs/:id/retryRetry failed job
POST/pki/jobs/:id/cancelCancel pending job
GET/pki/audit-logsPKI audit trail
GET/pki/expiringCertificates nearing expiry
GET/pki/revocationsRevocation list
POST/pki/bundles/publishPublish trust bundle
GET/pki/bundlesList trust bundles

App Certificate Packages

MethodPathDescription
GET/apps/:app_id/cert-packagesList app cert packages
POST/apps/:app_id/cert-packagesCreate cert package
GET/apps/:app_id/cert-packages/:pid/downloadDownload package

Security

MethodPathDescription
GET/login-logsUser login logs
GET/audit-logsUser audit logs
GET/agent-login-logsAgent login logs
GET/agent-audit-logsAgent audit logs
GET/agent-tokensActive agent tokens
DELETE/agent-tokens/:agent_idRevoke agent tokens
GET/tokensUser token overview
DELETE/tokens/user/:user_idBump user auth epoch
GET/blacklistServer blacklist
POST/blacklistAdd blacklist entry
PATCH/blacklist/:idUpdate entry
DELETE/blacklist/:idRemove entry
POST/blacklist/batch/removeBatch remove
GET/control-blacklistControl plane blacklist
POST/control-blacklistAdd entry
PATCH/control-blacklist/:idUpdate entry
DELETE/control-blacklist/:idRemove entry
POST/control-blacklist/batch/removeBatch remove

Reports

MethodPathDescription
GET/reports/login-dailyDaily login statistics
GET/reports/card-generated-dailyDaily card generation
GET/reports/card-activated-dailyDaily card activation
GET/reports/agent-login-dailyDaily agent login activity

Next Steps