Our engineers set up and run your first AI security scan. Get in touch

API authentication

← All docs

The Penaxtra public API uses bearer-token authentication scoped per workspace. Tokens are minted in the console, sealed-box encrypted at rest, and shown in cleartext exactly once at creation.

Mint a token

Console → Settings → API tokens → New token. Choose:

  • Name - operator-readable label
  • Scopes - one or more (see below)
  • Expiry - recommended 90 days for production tokens
  • IP allowlist (optional) - restrict the token to a CIDR range

The cleartext value is shown once. Capture it in a secret store before navigating away.

Authenticated request

curl -sS https://penaxtra.com/api/v2/endpoints \
  -H "Authorization: Bearer $TOKEN"

Available scopes

ScopeAllows
endpoints:readList endpoints
endpoints:writeCreate, update, delete endpoints
scans:readList scans and read one scan
scans:writeStart a scan
suites:readList saved scan suites
findings:readList findings and read one finding
findings:writeUpdate finding status (triage, fix, accept risk, mark false positive)
reports:readList reports, poll status, download the document
reports:writeQueue a report for generation
audit:readRead the tenant audit log
cloud_posture:readList cloud-posture runs
cloud_posture:writeStart a cloud-posture run
rag:readList RAG security runs
rag:writeStart a RAG security run
modelscan:readList model-scan runs
gateway:readRead gateway events, agents and policy
agents:readList agents
assets:readRead the AI asset inventory and the assembled AI-BOM
threats:readList correlated threats
compliance:readRead framework coverage
posture:readRead the posture summary

Pick the narrowest set the job needs. A CI job that starts a scan and reads the result needs scans:write and findings:read and nothing else.

Read and write are separate scopes on the same resource for a reason. Reading a report is cheap; generating one renders a document in a worker and can span the whole scan history. A dashboard that polls report status should hold reports:read only, so a leaked dashboard token cannot be used to queue work. The same split applies to scans, endpoints, findings, cloud posture and RAG.

Error semantics

CodeMeaning
401 missing_tokenNo Authorization header
401 invalid_tokenToken does not exist or is revoked
401 expired_tokenToken expiry has passed
403 missing_scopeToken lacks the required scope for the endpoint
403 ip_not_allowedCaller IP is outside the token's allowlist

Rotation

Tokens are rotatable from the console. The rotation flow:

  1. Mint the new token with the same scopes.
  2. Deploy the new token to consumers.
  3. Verify traffic on the new token via the audit log.
  4. Revoke the old token from Settings → API tokens.

Security notes

  • Tokens are stored as a SHA-256 hash; the cleartext is unrecoverable after creation.
  • Every request is rate-limited per token (see API rate limits).
  • Token usage is audit-logged with the token's short id (first eight chars of the SHA-256), the request path, and a 200/4xx/5xx outcome.

Related

Last reviewed: 2026-08-04. Reviewed by: Engineering. Content type: Developer documentation. Reach the maintainers: [email protected] .