Referencia API
Documentación completa de la API REST con ejemplos de petición/respuesta.
Base URL
https://api.quantumapi.eu/api/v1Authentication — 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
| Method | Endpoint | Description |
|---|---|---|
| POST | /encrypt | Encrypt plaintext |
| POST | /decrypt | Decrypt ciphertext |
| POST | /sign | Create signature |
| POST | /verify | Verify signature |
Keys
| Method | Endpoint | Description |
|---|---|---|
| GET | /keys | List keys |
| POST | /keys | Generate key |
| POST | /keys/{keyId}/rotate | Rotate key |
| GET | /keys/{keyId}/public | Get public key (supports ?include=) |
Secrets
| Method | Endpoint | Description |
|---|---|---|
| GET | /secrets | List secrets |
| POST | /secrets | Create secret |
| GET | /secrets/{id} | Get secret (supports ?include=) |
Applications & end-users
| Method | Endpoint | Description |
|---|---|---|
| GET | /applications | List OIDC applications (applications:read) |
| POST | /applications | Create OIDC application with optional RFC 8707 resources (applications:write) |
| PUT | /applications/{id} | Update OIDC application — incl. resources (applications:write) |
| GET | /endusers | List end-users (endusers:read) |
| POST | /endusers/{id}/block | Block end-user (atomic across Identity + EaaS) |
| POST | /endusers/{id}/unblock | Unblock end-user |
| DELETE | /endusers/{id}/permanent | Permanent end-user removal |
| POST | /applications/{appId}/end-users/{id}/generate-temporary-password | Generate a one-time temporary password; user must change it at next login (endusers:write) |
Team & settings
| Method | Endpoint | Description |
|---|---|---|
| POST | /team/invitations | Invite a tenant team member (non-blocking) |
| PATCH | /settings/security | Update tenant security settings (tenant:admin/owner) |
Compliance
| Method | Endpoint | Description |
|---|---|---|
| GET | /compliance | Scores 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-acceptance | Accept 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-acceptance | Revoke the open acceptance; returns 200 with the revoked acceptance (audited) |
| GET | /compliance/risk-acceptances | Risk acceptance register, newest first, including revoked and expired ones |
Log streams
| Method | Endpoint | Description |
|---|---|---|
| GET | /log-streams | List destinations (Webhook, Datadog, Splunk, File) (tenant owner/admin) |
| POST | /log-streams | Create a destination; File: configJson "{\"retentionDays\":7|30|365}" (default 30) |
| GET | /log-streams/{id}/files | File 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
| Method | Endpoint | Description |
|---|---|---|
| GET | /usage/storage | Storage 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
| Method | Endpoint | Description |
|---|---|---|
| POST | /qrng/entropy | Draw quantum entropy: bytes 1..65536, format raw|hex|uuid|int32|int64, optional X-Allow-Csprng header (qrng:read, 100 req/min, SaaS only) |
| GET | /health | Service 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.
| Scope | Grants access to | Shipped in |
|---|---|---|
| encrypt | POST /encrypt | 0.1.x-beta |
| decrypt | POST /decrypt | 0.1.x-beta |
| sign | POST /sign | 0.1.x-beta |
| verify | POST /verify | 0.1.x-beta |
| keys:read / keys:write | GET /keys, POST /keys, /rotate, /import, … | 0.1.x-beta |
| secrets:read / secrets:write | GET /secrets, POST /secrets, … | 0.1.x-beta |
| resourcegroups:read / resourcegroups:write | GET/POST /resource-groups and their items | 0.9.0-beta |
| applications:read / applications:write | GET/POST /applications, OIDC client management | 0.18.0-rc.1 |
| endusers:read / endusers:write | GET/POST /endusers, /block, /unblock, /permanent, /generate-temporary-password | 0.18.0-rc.1 |
| roles:read / roles:write | GET/POST /roles, role assignments per application | 0.20.0-rc.4 |
| scim:manage | SCIM 2.0 provisioning endpoints (/scim/v2) | 0.x-beta (#418) |
| qrng:read | POST /qrng/entropy — QRNG bridge, quantum entropy metered per month (SaaS only) | unreleased (#719) |
| audit:read | GET /audit-logs — tenant audit log: key usage (encrypt, decrypt, sign, verify, …) and tenant actions | unreleased |
?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).
| Endpoint | Supported tokens |
|---|---|
| GET /secrets/{id} | customFields, notes, labels, description, expiresAt, folderId, isActive, isFavorite, hasTotp, isTravelSafe, createdAt, updatedAt, createdBy, updatedBy, metadata, all |
| GET /keys/{id}/public | name, 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,stateSettings & 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.
| Method | Endpoint | Behavior |
|---|---|---|
| POST | /endusers/{id}/block | Disables Identity sign-in + flags EaaS record. Compensating revert on EaaS save failure. Idempotent. |
| POST | /endusers/{id}/unblock | Re-enables Identity sign-in. Same compensating-revert semantics as /block. |
| DELETE | /endusers/{id}/permanent | Permanent 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"]
}