Documentation Reference HTTP API
HTTP API
Conventions of Structam's JSON API (authentication, errors, lists, limits) and every route the server mounts, with the permission and host scope each needs.
On this page
Conventions
Authentication
Reading the route tables
Routes
The web UI uses the same API that is documented here; anything the UI does, a script can do with an API token. The route list below is generated from the routes the server mounts, which a product test keeps in step with the code.
Conventions#
Base path /api/v1. Requests and responses are JSON (snake_case, RFC 3339 times, ids as numbers). Request bodies are limited to 2 MiB, and unknown fields are refused. Errors: {"error": {"code", "message", "request_id"}}. Lists: {"items", "total", "limit", "offset"} with limit from 1 to 1 000 (default 100). Every response carries X-Request-ID and X-Structam-Version. Quote the request id when you report a problem: the server logs it with every 5xx answer, and audit events written by the request carry it. While the database's synchronous commits are stalled, requests that change something answer 503 busy with Retry-After. The worker role serves only /livez, /readyz and /metrics (on STRUCTAM_WORKER_ADDR, without authentication).
Authentication#
A signed-in user's session cookie, or Authorization: Bearer stt_... (an API token). A request with Authorization is judged by it alone. Tokens are never accepted in URLs. Cookie-authenticated requests that change something must be JSON and come from the public URL's origin (or one in STRUCTAM_ALLOWED_ORIGINS); there is no CORS. API tokens need the token scope export for every export, besides the permission (API tokens ).
curl -H "Authorization: Bearer $TOKEN" \
'https://structam.example.com/api/v1/hosts?limit=50'
Reading the route tables#
Access is what the caller needs: a permission (held through a role grant), a token scope (API tokens only), "signed in" (any authenticated principal), or public. "People only" routes answer 403 user_required to API tokens.Host scope "yes" means the route returns or changes host data and filters it by the caller's site, tenant and tag scope for that permission: a host outside the scope answers 404, as if it did not exist.The permissions and built-in roles are listed on the access control page.
Routes#
/api/v1/access#
Method Path Access Host scope GET /api/v1/access/directory-group-mapsusers.managePOST /api/v1/access/directory-group-mapsusers.manageDELETE /api/v1/access/directory-group-maps/{id}users.managePUT /api/v1/access/directory-group-maps/{id}users.manageGET /api/v1/access/grantsusers.managePOST /api/v1/access/grantsusers.manageDELETE /api/v1/access/grants/{id}users.managePUT /api/v1/access/grants/{id}users.manageGET /api/v1/access/groupsusers.managePOST /api/v1/access/groupsusers.manageDELETE /api/v1/access/groups/{id}users.manageGET /api/v1/access/groups/{id}users.managePUT /api/v1/access/groups/{id}users.manageDELETE /api/v1/access/groups/{id}/members/{user_id}users.managePUT /api/v1/access/groups/{id}/members/{user_id}users.manageGET /api/v1/access/permissionsusers.manageGET /api/v1/access/rolesusers.managePOST /api/v1/access/rolesusers.manageDELETE /api/v1/access/roles/{name}users.managePUT /api/v1/access/roles/{name}users.manageGET /api/v1/access/tokensusers.managePOST /api/v1/access/tokensusers.manage; people only (API tokens get 403 user_required)DELETE /api/v1/access/tokens/{id}users.managePUT /api/v1/access/tokens/{id}users.manageGET /api/v1/access/usersusers.managePOST /api/v1/access/usersusers.manageDELETE /api/v1/access/users/{id}users.manageGET /api/v1/access/users/{id}users.managePUT /api/v1/access/users/{id}users.managePOST /api/v1/access/users/{id}/identitiesusers.manageDELETE /api/v1/access/users/{id}/identities/{identity_id}users.managePOST /api/v1/access/users/{id}/reset-passwordusers.managePOST /api/v1/access/users/{id}/reset-totpusers.managePOST /api/v1/access/users/{id}/revoke-sessionsusers.managePOST /api/v1/access/users/{id}/unlockusers.manage
/api/v1/account#
Method Path Access Host scope GET /api/v1/accountsigned in; people only (API tokens get 403 user_required); also while a password change is pending DELETE /api/v1/account/identities/{id}signed in; people only (API tokens get 403 user_required) POST /api/v1/account/identities/{slug}/linksigned in; people only (API tokens get 403 user_required) POST /api/v1/account/recovery-codessigned in; people only (API tokens get 403 user_required) GET /api/v1/account/sessionssigned in; people only (API tokens get 403 user_required) DELETE /api/v1/account/sessions/{id}signed in; people only (API tokens get 403 user_required) GET /api/v1/account/tokenssigned in; people only (API tokens get 403 user_required) POST /api/v1/account/tokenssigned in; people only (API tokens get 403 user_required) DELETE /api/v1/account/tokens/{id}signed in; people only (API tokens get 403 user_required) DELETE /api/v1/account/totpsigned in; people only (API tokens get 403 user_required) POST /api/v1/account/totp/confirmsigned in; people only (API tokens get 403 user_required); also while a password change is pending POST /api/v1/account/totp/setupsigned in; people only (API tokens get 403 user_required); also while a password change is pending
/api/v1/agent-releases#
Method Path Access Host scope GET /api/v1/agent-releasesviewyes
/api/v1/agents#
Method Path Access Host scope GET /api/v1/agentsviewyes GET /api/v1/agents/{id}viewyes POST /api/v1/agents/{id}/commandagents.manageyes POST /api/v1/agents/{id}/matchagents.manageyes POST /api/v1/agents/{id}/revokeagents.manageyes
/api/v1/assistant#
Method Path Access Host scope GET /api/v1/assistantassistant.use; people only (API tokens get 403 user_required)POST /api/v1/assistant/askassistant.use; people only (API tokens get 403 user_required)yes GET /api/v1/assistant/conversationsassistant.use; people only (API tokens get 403 user_required)DELETE /api/v1/assistant/conversations/{id}assistant.use; people only (API tokens get 403 user_required)GET /api/v1/assistant/conversations/{id}assistant.use; people only (API tokens get 403 user_required)
/api/v1/audit#
Method Path Access Host scope GET /api/v1/auditaudit.viewGET /api/v1/audit/actionsaudit.viewGET /api/v1/audit/exportaudit.view; API tokens also need scope exportGET /api/v1/audit/verifyaudit.view
/api/v1/audit-sinks#
Method Path Access Host scope GET /api/v1/audit-sinksintegrations.managePOST /api/v1/audit-sinksintegrations.manageGET /api/v1/audit-sinks/optionsintegrations.manageDELETE /api/v1/audit-sinks/{id}integrations.manageGET /api/v1/audit-sinks/{id}integrations.managePUT /api/v1/audit-sinks/{id}integrations.managePOST /api/v1/audit-sinks/{id}/skip-to-nowintegrations.managePOST /api/v1/audit-sinks/{id}/testintegrations.manage
/api/v1/auth#
Method Path Access Host scope POST /api/v1/auth/loginpublic POST /api/v1/auth/logoutpublic GET /api/v1/auth/mesigned in; people only (API tokens get 403 user_required); also while a password change is pending GET /api/v1/auth/oidc/{slug}/callbackpublic GET /api/v1/auth/oidc/{slug}/startpublic POST /api/v1/auth/passwordsigned in; people only (API tokens get 403 user_required); also while a password change is pending GET /api/v1/auth/providerspublic POST /api/v1/auth/reauthsigned in; people only (API tokens get 403 user_required); also while a password change is pending POST /api/v1/auth/totppublic
/api/v1/change-rules#
Method Path Access Host scope GET /api/v1/change-rulespolicies.managePOST /api/v1/change-rulespolicies.manageDELETE /api/v1/change-rules/{id}policies.manageGET /api/v1/change-rules/{id}policies.managePUT /api/v1/change-rules/{id}policies.manage
/api/v1/changes#
Method Path Access Host scope GET /api/v1/changesviewyes POST /api/v1/changes/reviewchanges.reviewyes GET /api/v1/changes/{id}viewyes POST /api/v1/changes/{id}/commentschanges.reviewyes POST /api/v1/changes/{id}/reviewchanges.reviewyes
/api/v1/configs#
Method Path Access Host scope GET /api/v1/configs/diffviewyes GET /api/v1/configs/driftviewyes GET /api/v1/configs/versions/{id}viewyes GET /api/v1/configs/versions/{id}/contentviewyes
/api/v1/discovery#
Method Path Access Host scope GET /api/v1/discovery/endpointsviewyes GET /api/v1/discovery/endpoints/{id}viewyes POST /api/v1/discovery/endpoints/{id}/ignoreintegrations.manageyes POST /api/v1/discovery/endpoints/{id}/unignoreintegrations.manageyes GET /api/v1/discovery/proposalsintegrations.manageGET /api/v1/discovery/runsviewGET /api/v1/discovery/targetsviewPOST /api/v1/discovery/targetsintegrations.manageDELETE /api/v1/discovery/targets/{id}integrations.manageGET /api/v1/discovery/targets/{id}viewPUT /api/v1/discovery/targets/{id}integrations.managePOST /api/v1/discovery/targets/{id}/sweepintegrations.manage
/api/v1/entitlements#
Method Path Access Host scope GET /api/v1/entitlementsviewPOST /api/v1/entitlementsassets.editDELETE /api/v1/entitlements/{id}assets.editGET /api/v1/entitlements/{id}viewPUT /api/v1/entitlements/{id}assets.edit
/api/v1/estate#
Method Path Access Host scope GET /api/v1/estate/anomaliesviewyes GET /api/v1/estate/applicationsviewyes GET /api/v1/estate/applications/{name}viewyes GET /api/v1/estate/configsviewyes GET /api/v1/estate/export.csvinventory.export; API tokens also need scope exportyes GET /api/v1/estate/hash/{sha256}viewyes GET /api/v1/estate/summaryviewyes
/api/v1/hosts#
Method Path Access Host scope GET /api/v1/hostsviewyes GET /api/v1/hosts/{id}viewyes GET /api/v1/hosts/{id}/accountsviewyes GET /api/v1/hosts/{id}/applicationsviewyes GET /api/v1/hosts/{id}/assetviewyes PUT /api/v1/hosts/{id}/assetassets.edityes GET /api/v1/hosts/{id}/changesviewyes GET /api/v1/hosts/{id}/changes/verifyaudit.viewyes GET /api/v1/hosts/{id}/componentsviewyes GET /api/v1/hosts/{id}/configsviewyes POST /api/v1/hosts/{id}/configs/baselinechanges.reviewyes GET /api/v1/hosts/{id}/configs/exportconfigs.content; API tokens also need scope exportyes GET /api/v1/hosts/{id}/configs/{file_id}viewyes GET /api/v1/hosts/{id}/configs/{file_id}/versionsviewyes GET /api/v1/hosts/{id}/executablesviewyes GET /api/v1/hosts/{id}/infradbviewyes GET /api/v1/hosts/{id}/notesviewyes POST /api/v1/hosts/{id}/notesassets.edityes DELETE /api/v1/hosts/{id}/notes/{note_id}assets.edityes PUT /api/v1/hosts/{id}/notes/{note_id}assets.edityes POST /api/v1/hosts/{id}/onboard-tokenagents.enrolyes GET /api/v1/hosts/{id}/patchesviewyes GET /api/v1/hosts/{id}/portsviewyes GET /api/v1/hosts/{id}/processesviewyes GET /api/v1/hosts/{id}/servicesviewyes
/api/v1/ingest#
Method Path Access Host scope POST /api/v1/ingest/infradb-audittoken scope ingest POST /api/v1/ingest/netboxpublic
/api/v1/integrations#
Method Path Access Host scope GET /api/v1/integrations/infradb/statusintegrations.managePOST /api/v1/integrations/infradb/syncintegrations.manageGET /api/v1/integrations/netboxintegrations.managePOST /api/v1/integrations/netbox/bootstrapintegrations.manageGET /api/v1/integrations/netbox/driftviewyes GET /api/v1/integrations/netbox/runsintegrations.managePOST /api/v1/integrations/netbox/syncintegrations.manage
/api/v1/join-tokens#
Method Path Access Host scope GET /api/v1/join-tokensagents.enrolyes POST /api/v1/join-tokensagents.enrolyes DELETE /api/v1/join-tokens/{id}agents.enrolyes
Method Path Access Host scope GET /api/v1/metaviewyes
/api/v1/os-eol#
Method Path Access Host scope GET /api/v1/os-eolviewPOST /api/v1/os-eolassets.editDELETE /api/v1/os-eol/{id}assets.editPUT /api/v1/os-eol/{id}assets.edit
/api/v1/policies#
Method Path Access Host scope GET /api/v1/policiespolicies.managePOST /api/v1/policiespolicies.manageDELETE /api/v1/policies/{id}policies.manageGET /api/v1/policies/{id}policies.managePUT /api/v1/policies/{id}policies.manage
/api/v1/policy-assignments#
Method Path Access Host scope GET /api/v1/policy-assignmentspolicies.managePOST /api/v1/policy-assignmentspolicies.manageDELETE /api/v1/policy-assignments/{id}policies.managePUT /api/v1/policy-assignments/{id}policies.manage
/api/v1/reports#
Method Path Access Host scope GET /api/v1/reportsviewGET /api/v1/reports/{name}viewyes
/api/v1/settings#
Method Path Access Host scope DELETE /api/v1/settings/auth-policyusers.manageGET /api/v1/settings/auth-policyusers.managePUT /api/v1/settings/auth-policyusers.manageDELETE /api/v1/settings/discoveryintegrations.manageGET /api/v1/settings/discoveryintegrations.managePUT /api/v1/settings/discoveryintegrations.manageDELETE /api/v1/settings/infradbintegrations.manageGET /api/v1/settings/infradbintegrations.managePUT /api/v1/settings/infradbintegrations.managePOST /api/v1/settings/infradb/testintegrations.manageDELETE /api/v1/settings/ldapusers.manageGET /api/v1/settings/ldapusers.managePUT /api/v1/settings/ldapusers.managePOST /api/v1/settings/ldap/testusers.manageDELETE /api/v1/settings/llmintegrations.manageGET /api/v1/settings/llmintegrations.managePUT /api/v1/settings/llmintegrations.managePOST /api/v1/settings/llm/testintegrations.manageDELETE /api/v1/settings/netboxintegrations.manageGET /api/v1/settings/netboxintegrations.managePUT /api/v1/settings/netboxintegrations.managePOST /api/v1/settings/netbox/testintegrations.manageGET /api/v1/settings/oidcusers.manageDELETE /api/v1/settings/oidc/{slug}users.manageGET /api/v1/settings/oidc/{slug}users.managePUT /api/v1/settings/oidc/{slug}users.managePOST /api/v1/settings/oidc/{slug}/testusers.manageDELETE /api/v1/settings/onboardsystem.manageGET /api/v1/settings/onboardsystem.managePUT /api/v1/settings/onboardsystem.manage
/api/v1/stream#
Method Path Access Host scope GET /api/v1/streamview
/api/v1/system#
Method Path Access Host scope GET /api/v1/system/leasessystem.managePOST /api/v1/system/leases/{task}system.manageGET /api/v1/system/licencesystem.managePOST /api/v1/system/licencesystem.managePOST /api/v1/system/licence/activatesystem.manageGET /api/v1/system/nodessystem.manageGET /api/v1/system/queuesystem.managePOST /api/v1/system/queue/work/{id}/retrysystem.managePOST /api/v1/system/queue/{id}/retrysystem.manage
/api/v1/taxii#
Method Path Access Host scope GET /api/v1/taxii/collectionsintegrations.managePUT /api/v1/taxii/collections/{name}integrations.manage
/agent#
Method Path Access Host scope GET /agent/v1/connectagent WebSocket: admission stamp, then the signed handshake (security model ) GET /agent/v1/download/{os}/{arch}public GET /agent/v1/manifestpublic GET /agent/v1/manifest.sigpublic
/onboard#
Method Path Access Host scope GET /onboard/install.ps1public GET /onboard/install.shpublic GET /onboard/status/{fingerprint}public
/taxii2#
Method Path Access Host scope any /taxii2/API token with scope taxii (Bearer, or Basic with the token as password); audit needs audit.view, the others view, filtered by the token's host scope yes
probes and metrics#
Method Path Access Host scope GET /healthzpublic: alias of /livez GET /livezpublic: process liveness, never touches the database GET /metricstoken scope metrics GET /metrics/federatetoken scope metrics + view yes GET /readyzpublic: primary reachable, schema compatible, not draining
web UI and fallback#
Method Path Access Host scope any /public: the web UI (single-page app and its assets) any /api/public: 404 not_found for every API path no route matches
Questions the docs do not answer?
Ask the people who build Structam. Installation media and licences come from KazLabs.
Talk to us