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

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

MethodPathAccessHost scope
GET/api/v1/access/directory-group-mapsusers.manage
POST/api/v1/access/directory-group-mapsusers.manage
DELETE/api/v1/access/directory-group-maps/{id}users.manage
PUT/api/v1/access/directory-group-maps/{id}users.manage
GET/api/v1/access/grantsusers.manage
POST/api/v1/access/grantsusers.manage
DELETE/api/v1/access/grants/{id}users.manage
PUT/api/v1/access/grants/{id}users.manage
GET/api/v1/access/groupsusers.manage
POST/api/v1/access/groupsusers.manage
DELETE/api/v1/access/groups/{id}users.manage
GET/api/v1/access/groups/{id}users.manage
PUT/api/v1/access/groups/{id}users.manage
DELETE/api/v1/access/groups/{id}/members/{user_id}users.manage
PUT/api/v1/access/groups/{id}/members/{user_id}users.manage
GET/api/v1/access/permissionsusers.manage
GET/api/v1/access/rolesusers.manage
POST/api/v1/access/rolesusers.manage
DELETE/api/v1/access/roles/{name}users.manage
PUT/api/v1/access/roles/{name}users.manage
GET/api/v1/access/tokensusers.manage
POST/api/v1/access/tokensusers.manage; people only (API tokens get 403 user_required)
DELETE/api/v1/access/tokens/{id}users.manage
PUT/api/v1/access/tokens/{id}users.manage
GET/api/v1/access/usersusers.manage
POST/api/v1/access/usersusers.manage
DELETE/api/v1/access/users/{id}users.manage
GET/api/v1/access/users/{id}users.manage
PUT/api/v1/access/users/{id}users.manage
POST/api/v1/access/users/{id}/identitiesusers.manage
DELETE/api/v1/access/users/{id}/identities/{identity_id}users.manage
POST/api/v1/access/users/{id}/reset-passwordusers.manage
POST/api/v1/access/users/{id}/reset-totpusers.manage
POST/api/v1/access/users/{id}/revoke-sessionsusers.manage
POST/api/v1/access/users/{id}/unlockusers.manage

/api/v1/account

MethodPathAccessHost 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

MethodPathAccessHost scope
GET/api/v1/agent-releasesviewyes

/api/v1/agents

MethodPathAccessHost 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

MethodPathAccessHost 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

MethodPathAccessHost scope
GET/api/v1/auditaudit.view
GET/api/v1/audit/actionsaudit.view
GET/api/v1/audit/exportaudit.view; API tokens also need scope export
GET/api/v1/audit/verifyaudit.view

/api/v1/audit-sinks

MethodPathAccessHost scope
GET/api/v1/audit-sinksintegrations.manage
POST/api/v1/audit-sinksintegrations.manage
GET/api/v1/audit-sinks/optionsintegrations.manage
DELETE/api/v1/audit-sinks/{id}integrations.manage
GET/api/v1/audit-sinks/{id}integrations.manage
PUT/api/v1/audit-sinks/{id}integrations.manage
POST/api/v1/audit-sinks/{id}/skip-to-nowintegrations.manage
POST/api/v1/audit-sinks/{id}/testintegrations.manage

/api/v1/auth

MethodPathAccessHost 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

MethodPathAccessHost scope
GET/api/v1/change-rulespolicies.manage
POST/api/v1/change-rulespolicies.manage
DELETE/api/v1/change-rules/{id}policies.manage
GET/api/v1/change-rules/{id}policies.manage
PUT/api/v1/change-rules/{id}policies.manage

/api/v1/changes

MethodPathAccessHost 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

MethodPathAccessHost 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

MethodPathAccessHost 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.manage
GET/api/v1/discovery/runsview
GET/api/v1/discovery/targetsview
POST/api/v1/discovery/targetsintegrations.manage
DELETE/api/v1/discovery/targets/{id}integrations.manage
GET/api/v1/discovery/targets/{id}view
PUT/api/v1/discovery/targets/{id}integrations.manage
POST/api/v1/discovery/targets/{id}/sweepintegrations.manage

/api/v1/entitlements

MethodPathAccessHost scope
GET/api/v1/entitlementsview
POST/api/v1/entitlementsassets.edit
DELETE/api/v1/entitlements/{id}assets.edit
GET/api/v1/entitlements/{id}view
PUT/api/v1/entitlements/{id}assets.edit

/api/v1/estate

MethodPathAccessHost 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

MethodPathAccessHost 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

MethodPathAccessHost scope
POST/api/v1/ingest/infradb-audittoken scope ingest
POST/api/v1/ingest/netboxpublic

/api/v1/integrations

MethodPathAccessHost scope
GET/api/v1/integrations/infradb/statusintegrations.manage
POST/api/v1/integrations/infradb/syncintegrations.manage
GET/api/v1/integrations/netboxintegrations.manage
POST/api/v1/integrations/netbox/bootstrapintegrations.manage
GET/api/v1/integrations/netbox/driftviewyes
GET/api/v1/integrations/netbox/runsintegrations.manage
POST/api/v1/integrations/netbox/syncintegrations.manage

/api/v1/join-tokens

MethodPathAccessHost scope
GET/api/v1/join-tokensagents.enrolyes
POST/api/v1/join-tokensagents.enrolyes
DELETE/api/v1/join-tokens/{id}agents.enrolyes

/api/v1/meta

MethodPathAccessHost scope
GET/api/v1/metaviewyes

/api/v1/os-eol

MethodPathAccessHost scope
GET/api/v1/os-eolview
POST/api/v1/os-eolassets.edit
DELETE/api/v1/os-eol/{id}assets.edit
PUT/api/v1/os-eol/{id}assets.edit

/api/v1/policies

MethodPathAccessHost scope
GET/api/v1/policiespolicies.manage
POST/api/v1/policiespolicies.manage
DELETE/api/v1/policies/{id}policies.manage
GET/api/v1/policies/{id}policies.manage
PUT/api/v1/policies/{id}policies.manage

/api/v1/policy-assignments

MethodPathAccessHost scope
GET/api/v1/policy-assignmentspolicies.manage
POST/api/v1/policy-assignmentspolicies.manage
DELETE/api/v1/policy-assignments/{id}policies.manage
PUT/api/v1/policy-assignments/{id}policies.manage

/api/v1/reports

MethodPathAccessHost scope
GET/api/v1/reportsview
GET/api/v1/reports/{name}viewyes

/api/v1/settings

MethodPathAccessHost scope
DELETE/api/v1/settings/auth-policyusers.manage
GET/api/v1/settings/auth-policyusers.manage
PUT/api/v1/settings/auth-policyusers.manage
DELETE/api/v1/settings/discoveryintegrations.manage
GET/api/v1/settings/discoveryintegrations.manage
PUT/api/v1/settings/discoveryintegrations.manage
DELETE/api/v1/settings/infradbintegrations.manage
GET/api/v1/settings/infradbintegrations.manage
PUT/api/v1/settings/infradbintegrations.manage
POST/api/v1/settings/infradb/testintegrations.manage
DELETE/api/v1/settings/ldapusers.manage
GET/api/v1/settings/ldapusers.manage
PUT/api/v1/settings/ldapusers.manage
POST/api/v1/settings/ldap/testusers.manage
DELETE/api/v1/settings/llmintegrations.manage
GET/api/v1/settings/llmintegrations.manage
PUT/api/v1/settings/llmintegrations.manage
POST/api/v1/settings/llm/testintegrations.manage
DELETE/api/v1/settings/netboxintegrations.manage
GET/api/v1/settings/netboxintegrations.manage
PUT/api/v1/settings/netboxintegrations.manage
POST/api/v1/settings/netbox/testintegrations.manage
GET/api/v1/settings/oidcusers.manage
DELETE/api/v1/settings/oidc/{slug}users.manage
GET/api/v1/settings/oidc/{slug}users.manage
PUT/api/v1/settings/oidc/{slug}users.manage
POST/api/v1/settings/oidc/{slug}/testusers.manage
DELETE/api/v1/settings/onboardsystem.manage
GET/api/v1/settings/onboardsystem.manage
PUT/api/v1/settings/onboardsystem.manage

/api/v1/stream

MethodPathAccessHost scope
GET/api/v1/streamview

/api/v1/system

MethodPathAccessHost scope
GET/api/v1/system/leasessystem.manage
POST/api/v1/system/leases/{task}system.manage
GET/api/v1/system/licencesystem.manage
POST/api/v1/system/licencesystem.manage
POST/api/v1/system/licence/activatesystem.manage
GET/api/v1/system/nodessystem.manage
GET/api/v1/system/queuesystem.manage
POST/api/v1/system/queue/work/{id}/retrysystem.manage
POST/api/v1/system/queue/{id}/retrysystem.manage

/api/v1/taxii

MethodPathAccessHost scope
GET/api/v1/taxii/collectionsintegrations.manage
PUT/api/v1/taxii/collections/{name}integrations.manage

/agent

MethodPathAccessHost 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

MethodPathAccessHost scope
GET/onboard/install.ps1public
GET/onboard/install.shpublic
GET/onboard/status/{fingerprint}public

/taxii2

MethodPathAccessHost 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 scopeyes

probes and metrics

MethodPathAccessHost scope
GET/healthzpublic: alias of /livez
GET/livezpublic: process liveness, never touches the database
GET/metricstoken scope metrics
GET/metrics/federatetoken scope metrics + viewyes
GET/readyzpublic: primary reachable, schema compatible, not draining

web UI and fallback

MethodPathAccessHost 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