QuantumAPI

Referencia API

Documentación completa de la API REST con ejemplos de petición/respuesta.

Base URL

https://api.quantumapi.eu/api/v1

Authentication — single credential

Every request authenticates with the X-Api-Key header. The key alone is sufficient — there is no JWT exchange, no session cookie, no second credential. The middleware order is enforced server-side (ApiKeyAuthorizationHandler runs before any other authorization handler), so a valid API key produces an authenticated tenant context for the whole request without needing a Bearer token alongside it.

curl https://api.quantumapi.eu/api/v1/applications \
  -H "X-Api-Key: qapi_..."

Core Endpoints

Encryption & signatures

MethodEndpointDescription
POST/encryptEncrypt plaintext
POST/decryptDecrypt ciphertext
POST/signCreate signature
POST/verifyVerify signature

Keys

MethodEndpointDescription
GET/keysList keys
POST/keysGenerate key
POST/keys/{keyId}/rotateRotate key
GET/keys/{keyId}/publicGet public key (supports ?include=)

Secrets

MethodEndpointDescription
GET/secretsList secrets
POST/secretsCreate secret
GET/secrets/{id}Get secret (supports ?include=)

Applications & end-users

MethodEndpointDescription
GET/applicationsList OIDC applications (applications:read)
POST/applicationsCreate OIDC application with optional RFC 8707 resources (applications:write)
PUT/applications/{id}Update OIDC application — incl. resources (applications:write)
GET/endusersList end-users (endusers:read)
POST/endusers/{id}/blockBlock end-user (atomic across Identity + EaaS)
POST/endusers/{id}/unblockUnblock end-user
DELETE/endusers/{id}/permanentPermanent end-user removal
POST/applications/{appId}/end-users/{id}/generate-temporary-passwordGenerate a one-time temporary password; user must change it at next login (endusers:write)

Team & settings

MethodEndpointDescription
POST/team/invitationsInvite a tenant team member (non-blocking)
PATCH/settings/securityUpdate tenant security settings (tenant:admin/owner)

Compliance

MethodEndpointDescription
GET/complianceScores per framework (gdpr, nis2, dora, eidas2) with pass/warning/fail/riskAccepted counts (tenant owner/admin)
GET/compliance/{framework}Report: every check with id, status, evaluatedStatus and riskAcceptance
POST/compliance/{framework}/checks/{checkId}/risk-acceptanceAccept the risk of a Fail or Warning check: justification 10-2000 chars, optional future reviewDate (201; 409 if the check passes; audited)
DELETE/compliance/{framework}/checks/{checkId}/risk-acceptanceRevoke the open acceptance; returns 200 with the revoked acceptance (audited)
GET/compliance/risk-acceptancesRisk acceptance register, newest first, including revoked and expired ones

Log streams

MethodEndpointDescription
GET/log-streamsList destinations (Webhook, Datadog, Splunk, File) (tenant owner/admin)
POST/log-streamsCreate a destination; File: configJson "{\"retentionDays\":7|30|365}" (default 30)
GET/log-streams/{id}/filesFile destinations: daily archives (day, lineCount, sizeBytes), totalSizeBytes, retentionDays
GET/log-streams/{id}/files/{day}Download one UTC day (YYYY-MM-DD) as auth-logs-<day>.ndjson.gz (application/gzip, audited)

Usage

MethodEndpointDescription
GET/usage/storageStorage occupied per category (secrets, keys, certificates, attachments, log_archives): bytes now, month average, GB-month so far (any tenant role; informative, not invoiced yet)

QRNG & health

MethodEndpointDescription
POST/qrng/entropyDraw quantum entropy: bytes 1..65536, format raw|hex|uuid|int32|int64, optional X-Allow-Csprng header (qrng:read, 100 req/min, SaaS only)
GET/healthService health

Reference notes below cover scopes, ?include=, RBAC, end-user lifecycle, invitations and RFC 8707 resource indicators.

API key scopes

Each API key carries an explicit list of scopes. Resource scopes grant the corresponding HTTP verbs —:read covers GET, :write covers POST/PUT/PATCH/DELETE — while the cryptographic operations and the QRNG bridge use one scope per operation. Calls without the right scope return 403 witherror: "insufficient_scope". The list below is the complete catalog (ApiKeyScopes); a key cannot carry a scope that is not in it.

ScopeGrants access toShipped in
encryptPOST /encrypt0.1.x-beta
decryptPOST /decrypt0.1.x-beta
signPOST /sign0.1.x-beta
verifyPOST /verify0.1.x-beta
keys:read / keys:writeGET /keys, POST /keys, /rotate, /import, …0.1.x-beta
secrets:read / secrets:writeGET /secrets, POST /secrets, …0.1.x-beta
resourcegroups:read / resourcegroups:writeGET/POST /resource-groups and their items0.9.0-beta
applications:read / applications:writeGET/POST /applications, OIDC client management0.18.0-rc.1
endusers:read / endusers:writeGET/POST /endusers, /block, /unblock, /permanent, /generate-temporary-password0.18.0-rc.1
roles:read / roles:writeGET/POST /roles, role assignments per application0.20.0-rc.4
scim:manageSCIM 2.0 provisioning endpoints (/scim/v2)0.x-beta (#418)
qrng:readPOST /qrng/entropy — QRNG bridge, quantum entropy metered per month (SaaS only)unreleased (#719)
audit:readGET /audit-logs — tenant audit log: key usage (encrypt, decrypt, sign, verify, …) and tenant actionsunreleased

?include= — opt-in field hydration

Several GET endpoints return a minimal projection by default and let you ask for additional fields via the include query parameter (comma-separated). Two shortcuts are supported on every endpoint that accepts include: metadata selects every supported metadata field, andall selects everything (including the secret value where applicable).

EndpointSupported tokens
GET /secrets/{id}customFields, notes, labels, description, expiresAt, folderId, isActive, isFavorite, hasTotp, isTravelSafe, createdAt, updatedAt, createdBy, updatedBy, metadata, all
GET /keys/{id}/publicname, description, keyType, isPostQuantum, isActive, isDefault, isFavorite, createdAt, expiresAt, lastRotatedAt, labels, state, scheduledDeletionDate, metadata, all — not honoured for the ?format=jwk response (JWK fields are fixed by RFC 7517)
# Get a secret with custom fields, notes and labels in one call
GET /api/v1/secrets/sec_abc123?include=customFields,notes,labels

# Or use the metadata shortcut
GET /api/v1/secrets/sec_abc123?include=metadata

# Public key with rotation history fields
GET /api/v1/keys/key_xyz789/public?include=lastRotatedAt,labels,state

Settings & Security RBAC

Tenant-wide configuration changes require an elevated role. PATCH /api/v1/settings/security is restricted to tenant:owner and tenant:admin; tenant:developer,tenant:viewer, and any API key (regardless of scopes) receive 403 witherror: "forbidden". The same rule applies to other PATCH /api/v1/settings/*endpoints that mutate security or compliance posture.

PATCH /api/v1/settings/security
X-Api-Key: qapi_...                       # API key → 403, even with settings:write
# (use a session token from a tenant:admin/owner browser sign-in instead)

End-user lifecycle endpoints

End-user state transitions are atomic across the Identity context (login enabled / blocked) and the EaaS context (end-user record). On /block and /unblock a save failure on the EaaS save triggers a compensating revert on Identity, so the two contexts cannot drift. /permanent reorders deletion so Identity removal happens before the EaaS cascade — if the cascade fails partway, a retry self-heals without orphaning the Identity user. See #674.

MethodEndpointBehavior
POST/endusers/{id}/blockDisables Identity sign-in + flags EaaS record. Compensating revert on EaaS save failure. Idempotent.
POST/endusers/{id}/unblockRe-enables Identity sign-in. Same compensating-revert semantics as /block.
DELETE/endusers/{id}/permanentPermanent removal. Identity removed first; EaaS cascade follows so a partial failure is safely retryable.

Non-blocking team invitations

POST /api/v1/team/invitations returns within milliseconds even when SMTP is slow. The response is sent as soon as the invitation row is persisted; the invitation email is dispatched on a background task with a fresh DI scope, so an SMTP timeout (up to ~30s upstream) no longer blocks the HTTP request. The response payload includes emailDispatchStatus: "queued" so clients can show a "sending…" state and surface failures via the audit log.

POST /api/v1/team/invitations
X-Api-Key: qapi_...
Content-Type: application/json

{
  "email": "newhire@example.com",
  "role": "tenant:developer"
}

# Response (typically <50ms)
{
  "invitationId": "inv_abc123",
  "email": "newhire@example.com",
  "role": "tenant:developer",
  "expiresAt": "2026-05-08T12:00:00Z",
  "emailDispatchStatus": "queued"
}

RFC 8707 resource indicators on OAuth applications

OAuth/OIDC applications accept an optional resources array onPOST /api/v1/applications and PUT /api/v1/applications/{id}. Each value is an absolute URI identifying a protected resource server (e.g. https://api.example.com/mcp). At authorize time the client may send ?resource=<url>; the URL must match one of the declared values, otherwise the request is rejected. Tokens minted from a flow that included a valid resource carry an aud claim matching it. This is what MCP clients (claude.ai, Claude Desktop, Cursor) need to connect to a per-tenant resource server through QuantumID. On update, omitting the field leaves existing entries intact; passing an empty array clears them.

POST /api/v1/applications
X-Api-Key: qapi_...
Content-Type: application/json

{
  "name": "MCP Server",
  "applicationType": "SPA",
  "redirectUris": ["https://claude.ai/api/mcp/auth_callback"],
  "resources": ["https://api.example.com/mcp"]
}
Referencia API | QuantumAPI Docs