Docs / api-authentication

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 + read LLM endpoints
endpoints:writeCreate, update, delete endpoints
scans:readList + read scans, findings
scans:writeTrigger scans, cancel scans
findings:readList + read findings
findings:writeUpdate finding status (triage, resolve, accept, mark false positive)
reports:generateCreate reports
reports:readList + download reports
audit:readRead the tenant audit log
webhooks:writeManage webhook targets

Pick the narrowest set required for the use case; a per-CI-job token typically needs only scans:write + findings:read.

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-06-13. Reviewed by: Engineering. Content type: Developer documentation. Reach the maintainers: [email protected] .