QQShield

REST API

API reference

72 endpoints across 8 resources. Base path is /api/v1. See the authentication model for how to obtain a session token.

Authentication

Self-serve signup and email verification, session login (with optional TOTP MFA), and session management. Sessions are short-lived JWTs (see the Getting Started page) carried as a Bearer token.

POST/api/v1/auth/signupPublic

Create a new workspace and admin account

Gated by SIGNUP_ENABLED (off by default). Always returns the same response shape regardless of whether the email is new, already registered but unverified (sends a fresh verification link, and updates the password to the one just submitted), or already registered and verified (sends a “you already have an account” notice instead) — this is deliberate: the HTTP response never discloses which emails have accounts.

Request body

NameTypeDescription
emailrequiredstringValidated, normalized (lowercased) email address.
passwordrequiredstring12–200 characters. Length is enforced, not composition.
organization_namerequiredstringName for the new workspace.
websitestringHoneypot field. Leave empty — any non-empty value is silently treated as a bot submission.

Response{ message: string, email: string }

POST/api/v1/auth/verify-emailPublic

Confirm an email verification token

Request body

NameTypeDescription
tokenrequiredstringThe token from the verification link (24h expiry).

Response{ verified: true }

POST/api/v1/auth/loginPublic

Exchange credentials for a session

Rejects with 403 if the account's email isn't verified yet. If MFA is enabled, returns a short-lived (5 min) mfa_token instead of an access_token — complete the flow via /auth/mfa/verify.

Request body

NameTypeDescription
emailrequiredstring
passwordrequiredstring

Response{ access_token, token_type } or { mfa_required: true, mfa_token }

POST/api/v1/auth/mfa/verifyPublic

Complete login with a TOTP or recovery code

Request body

NameTypeDescription
mfa_tokenrequiredstringThe challenge token from /auth/login.
codestring6-digit TOTP code. Provide this or recovery_code, not both.
recovery_codestringOne of the single-use codes issued at MFA enrollment (see /auth/mfa/confirm).

Response{ access_token, token_type }

POST/api/v1/auth/mfa/enrollSession

Begin MFA enrollment

Generates a TOTP secret and stores it, but does not enable MFA until /auth/mfa/confirm succeeds — an unfinished enrollment can never lock an account out.

Response{ secret, provisioning_uri, qr_data_uri }

POST/api/v1/auth/mfa/confirmSession

Enable MFA with a confirmation code

Also generates 10 single-use recovery codes, returned exactly once in this response — there is no way to retrieve them again afterward, only to regenerate a fresh set (see /auth/mfa/recovery-codes/regenerate).

Request body

NameTypeDescription
coderequiredstring6-digit TOTP code from the enrolled authenticator.

Response{ mfa_enabled: true, recovery_codes: string[] }

POST/api/v1/auth/mfa/disableSession

Disable MFA

Requires a currently-valid TOTP code or an unused recovery code, not just a session token — a stolen bearer token alone can't turn MFA off. Deletes all remaining recovery codes.

Request body

NameTypeDescription
codestringProvide this or recovery_code, not both.
recovery_codestring

Response{ mfa_enabled: false }

POST/api/v1/auth/mfa/recovery-codes/regenerateSession

Invalidate all recovery codes and issue a fresh set

Requires a live TOTP code specifically — not a recovery code, so a single stolen recovery code can't be used to mint a whole new batch.

Request body

NameTypeDescription
coderequiredstring6-digit TOTP code.

Response{ recovery_codes: string[] }

POST/api/v1/auth/revoke-sessionsSession

Invalidate every session for this account

Bumps a per-user token version, invalidating every previously issued token at once — including the one used to call this endpoint. An all-or-nothing kill switch, not a per-device sign-out list.

Response{ revoked: true, message }

POST/api/v1/auth/change-passwordSession

Change your own password

Verifies the current password, then bumps the same per-user token version /auth/revoke-sessions uses — every other session is invalidated, and a fresh token is returned so the caller's own session survives the change.

Request body

NameTypeDescription
current_passwordrequiredstring
new_passwordrequiredstring12–200 characters.

Response{ access_token, token_type }

GET/api/v1/meSession

The authenticated user's identity

Email, role, workspace id/name, and MFA status for whoever the current session token belongs to.

Response{ email, role, workspace_id, workspace_name, mfa_enabled, mfa_recovery_codes_remaining }

API Keys

Scoped, revocable credentials for the MCP server or any other non-browser caller. See the MCP Server section for how these are used.

POST/api/v1/api-keysSession

Create an API key

The raw key is returned exactly once, in this response — only its SHA-256 hash is ever stored. It cannot be retrieved again.

Request body

NameTypeDescription
namerequiredstringA label to identify this key later.
scope"read_only" | "read_write"Defaults to read_only.

Response{ id, name, scope, key, key_prefix }

GET/api/v1/api-keysSession

List API keys in the current workspace

Never includes the raw key or its hash — only key_prefix, enough to recognize a key without revealing anything secret about it.

ResponseApiKeyView[]

POST/api/v1/api-keys/{api_key_id}/revokeSession

Revoke an API key

Immediate: an MCP server holding this key is re-validating it on every tool call and will be rejected on its very next call.

Response{ id, revoked: true }

Organizations & Projects

The Client → Project hierarchy: an Organization (Client) is a company or business unit being assessed; a Project is a specific system within it, connected to exactly one Connector.

GET/api/v1/portfolioSession

List every organization and its projects

Each project includes its latest real (non-synthetic-demo) assessment status.

Query parameters

NameTypeDescription
include_archivedbooleanDefaults to false.
POST/api/v1/clientsSession

Create an organization

Request body

NameTypeDescription
namerequiredstring2–200 characters.
industryrequiredstring2–120 characters.
descriptionstringUp to 2000 characters.
PATCH/api/v1/clients/{client_id}Session

Update an organization

Request body

NameTypeDescription
namerequiredstring
industryrequiredstring
descriptionstring
POST/api/v1/clients/{client_id}/archiveSession

Archive an organization

Soft-delete: hides it from the default portfolio listing, keeps all evidence and audit history intact.

POST/api/v1/clients/{client_id}/restoreSession

Restore an archived organization

GET/api/v1/clients/{client_id}/dashboardSession

Dashboard summary for one organization

Response{ client, projects: [...], average_risk }

POST/api/v1/clients/{client_id}/projectsSession

Create a project under an organization

No connector is attached automatically — “Run Assessment” stays disabled until one is connected.

Request body

NameTypeDescription
namerequiredstring
descriptionstring
environmentstringDefaults to "demo".
risk_profile"low" | "moderate" | "high" | "critical"Defaults to "moderate".
PATCH/api/v1/projects/{project_id}Session

Update a project

Request body

NameTypeDescription
namerequiredstring
descriptionstring
environmentstring
risk_profile"low" | "moderate" | "high" | "critical"
POST/api/v1/projects/{project_id}/archiveSession

Archive a project

POST/api/v1/projects/{project_id}/restoreSession

Restore an archived project

GET/api/v1/projects/{project_id}/risk-historySession

Risk-score trend for a project

Query parameters

NameTypeDescription
date_fromdateDefaults to 13 days before date_to.
date_todateDefaults to today.
GET/api/v1/projects/{project_id}/crypto-agilitySession

Crypto-agility score for a project

How easily this project's cryptography could be migrated — a distinct scoring dimension from risk.

POST/api/v1/demo/seedSession

(Re)seed demo organizations/projects/history for this workspace

Connectors

Connections to the systems being assessed — AWS accounts, GitHub/git repositories, and container registries. Every write route here requires the admin role, not just a session, since these routes create or validate credential-bearing connections.

GET/api/v1/modulesSession

Status/coverage of every assessment module

Reads from a project's latest real (non-synthetic-demo) scan.

Query parameters

NameTypeDescription
project_idstring
POST/api/v1/connectors/awsSession · Admin role

Create an AWS connector

Validated synchronously with a real STS call at creation time — a fresh connector already reports connected/disconnected, no separate validate call needed.

Request body

NameTypeDescription
namestring
mode"moto" | "aws"moto targets a local Moto emulator for testing.
endpoint_urlstring
regionsstring[]
role_arnstringRequired for mode="aws" — see the Terraform template endpoint below.
external_idstring
project_idstring
GET/api/v1/connectors/aws/terraform-templateSession · Admin role

Download a least-privilege cross-account IAM role template

Returns a ready-to-apply Terraform file, plus a fresh external_id in the X-QShield-External-Id response header — hold onto it and the role ARN Terraform outputs, then submit both to POST /connectors/aws.

Query parameters

NameTypeDescription
role_namestringDefaults to "qshield-pqc-readonly".
POST/api/v1/connectors/{connector_id}/validateSession · Admin role

Re-run STS validation for an AWS connector

POST/api/v1/connectors/githubSession · Admin role

Create and validate a GitHub connector

Request body

NameTypeDescription
namestring
auth_methodrequired"pat" | "github_app"
ownerrequiredstring
reporequiredstring
branchstring
personal_access_tokenstringRequired for auth_method="pat". Encrypted at rest, never logged.
installation_idstringRequired for auth_method="github_app".
project_idstring
POST/api/v1/connectors/{connector_id}/github-validateSession · Admin role

Re-run validation for a GitHub connector

POST/api/v1/connectors/git-repositorySession · Admin role

Create a generic git repository connector

Request body

NameTypeDescription
namestring
repository_urlrequiredstring
branchstring
access_token_env_varstringName of an env var on the API server holding a token, if the repo is private.
project_idstring
POST/api/v1/connectors/{connector_id}/git-syncSession · Admin role

Pull the latest commit for a git repository connector

POST/api/v1/connectors/container-registrySession · Admin role

Create and validate a container registry connector

Request body

NameTypeDescription
namestring
registry_urlrequiredstring
usernamestring
password_or_tokenstringEncrypted at rest, never logged.
project_idstring
GET/api/v1/connectorsSession · Admin role

List connectors

Query parameters

NameTypeDescription
project_idstring
PATCH/api/v1/connectors/{connector_id}Session · Admin role

Update a connector

Request body

NameTypeDescription
namerequiredstring
regionsrequiredstring[]
enabledbooleanDefaults to true.

Scans

Triggering and running assessments. A scan is a job against one connector; modules run within it either remotely (against the connected system) or from locally-uploaded evidence.

POST/api/v1/connectors/{connector_id}/scansSession

Trigger a scan

Runs asynchronously — poll GET /scans/{id} for status. Pass an Idempotency-Key header to make retries safe.

Request body

NameTypeDescription
modulesstring[]Defaults to ["aws_discovery"].
GET/api/v1/scansSession

List scan jobs

Query parameters

NameTypeDescription
project_idstring
GET/api/v1/scans/{scan_id}Session

Fetch one scan job

POST/api/v1/scanners/runSession

Run one local scanner module against an uploaded target

For modules that need locally-supplied evidence (source_code, dependencies, containers, certificates, network_services, databases) rather than remote discovery. For certificates and network_services specifically, findings are also written to the crypto inventory (CryptoOccurrence, plus a Finding for anything quantum-vulnerable) — the response's crypto_occurrences_written counts them. Other modules' findings still land only in this response's raw evidence pending a triage workflow (see docs/KNOWN_GAPS.md).

Request body

NameTypeDescription
scan_idrequiredstring
modulerequiredstring
target_kindrequiredstring
referencerequiredstring
optionsobject
POST/api/v1/scans/{scan_id}/derived-modules/{module_key}Session

Run a derived module

module_key is one of key_management, crypto_graph, migration_lab — modules computed from evidence already collected, not a new scan of a target.

Findings & Evidence

Reading scan results: findings, discovered assets, cryptographic inventory, the dependency graph, and the raw evidence backing all of it. Also the AI-assist endpoints — always non-authoritative drafts, never verified facts.

GET/api/v1/findingsSession

List findings, highest risk first

Query parameters

NameTypeDescription
scan_idstring
severitystring
GET/api/v1/findings/{finding_id}/migration-changeSession

Deterministic suggested diff, Jira ticket, and GitHub PR draft

Template-based, not AI-generated.

POST/api/v1/findings/{finding_id}/explainSession

AI-drafted explanation of a finding

Non-authoritative — always a draft requiring human review. Logged to an audit table with the provider/model used. 403s unless both a deployment-level provider is configured AND this workspace has opted in (see GET/PATCH /workspace/llm-settings).

POST/api/v1/findings/{finding_id}/draft-remediationSession

AI-drafted migration backlog item

Same LLM-availability gate as /explain — see that entry.

POST/api/v1/findings/query-planSession

Turn a natural-language question into a structured finding filter

Never generates or executes raw SQL — returns a validated filter the client applies explicitly. Same LLM-availability gate as /explain.

Request body

NameTypeDescription
queryrequiredstring3–2000 characters.
GET/api/v1/workspace/llm-settingsSession

Whether this workspace has opted into LLM data sharing

Response{ data_sharing_enabled, provider_configured }

PATCH/api/v1/workspace/llm-settingsSession · Admin role

Turn LLM data sharing on/off for this workspace

The per-tenant consent gate on top of the deployment-wide LLM_PROVIDER setting — both must be true for any AI-assisted endpoint to work, not either alone.

Request body

NameTypeDescription
data_sharing_enabledrequiredboolean

Response{ data_sharing_enabled, provider_configured }

POST/api/v1/policies/extract-draftsSession

Extract candidate machine-testable rules from policy text

Same LLM-availability gate as /findings/{finding_id}/explain.

Request body

NameTypeDescription
policy_textrequiredstring20–100,000 characters.
GET/api/v1/assetsSession

List discovered assets for a scan

Query parameters

NameTypeDescription
scan_idrequiredstring
GET/api/v1/crypto-occurrencesSession

List cryptographic algorithm occurrences for a scan

Each occurrence carries algorithm, purpose, confidence, and quantum_status.

Query parameters

NameTypeDescription
scan_idrequiredstring
GET/api/v1/relationshipsSession

List dependency-graph edges for a scan

Query parameters

NameTypeDescription
scan_idrequiredstring
GET/api/v1/evidence/{evidence_id}Session

Fetch one raw evidence record

Includes everything derived from it: asset, occurrence, and finding ids. Evidence rows are append-only — immutable once written.

GET/api/v1/scans/{scan_id}/roadmapSession

Migration roadmap for a scan

Prioritized waves of remediation actions, persisted as MigrationAction rows on first computation.

GET/api/v1/graphSession

Asset dependency graph for a scan

Query parameters

NameTypeDescription
scan_idrequiredstring
rootstringOptional: return only the subgraph reachable from this asset.
depthint1–5, defaults to 2.
limitint1–1000, defaults to 500.

Reports, Audit & Compliance

Signed evidence bundles, audit chain verification, signing-key rotation, and raw-evidence retention.

POST/api/v1/scans/{scan_id}/reportsSession

Generate a signed evidence bundle for a scan

Response{ report_id, manifest_hash, download_url }

GET/api/v1/scans/{scan_id}/cbomSession

Export a Cryptography Bill of Materials for a scan

A CycloneDX 1.6 document (bomFormat/specVersion/cryptographic-asset components) built from this scan's existing crypto-occurrence evidence — the format referenced by the EU Cyber Resilience Act, DORA, and CNSA 2.0/NSM-10 compliance programs. Not a separate collection pass.

ResponseCycloneDX 1.6 JSON document

GET/api/v1/scans/{scan_id}/compliance/cnsa2Session

CNSA 2.0 readiness for a scan's cryptographic evidence

Exact-match against CNSA 2.0's approved suite (ML-KEM-1024, ML-DSA-87, AES-256, SHA-384/512 only — explicitly not the smaller ML-KEM-512/768 or ML-DSA-44/65 parameter sets) — the technical bar NSM-10 requires for National Security System acquisitions from 2027-01-01.

Response{ framework, total_occurrences, compliant, excluded, not_covered, compliant_fraction, gaps: [{ occurrence_id, asset_id, algorithm, parameter_set, status }] }

GET/api/v1/reports/{report_id}/downloadSession

Download a report bundle (.zip)

POST/api/v1/reports/{report_id}/verifySession

Verify a report bundle's Ed25519 signature

GET/api/v1/audit/verifySession

Verify the audit log's hash chain end-to-end

POST/api/v1/admin/signing-key/rotateSession

Rotate the report-signing key

GET/api/v1/admin/retention/previewSession

Preview raw evidence that would be purged

Query parameters

NameTypeDescription
older_than_daysintDefaults to RAW_EVIDENCE_RETENTION_DAYS.
POST/api/v1/admin/retention/purgeSession

Purge expired raw evidence

Only ever removes raw evidence blobs backing already-concluded findings — never findings, audit events, or reports themselves.

Request body

NameTypeDescription
older_than_daysint

Public Survey Data

A completely separate, unauthenticated dataset: public-internet research findings (public GitHub repos, Docker images, CT logs, package registries) from QShield's own detection-accuracy survey pipeline — not customer or workspace data.

GET/api/v1/survey/summaryPublic

Aggregate survey summary

Response{ database_available, sources, findings_by_category, top_algorithms, vulnerabilities_by_severity, top_vulnerable_packages, total_findings, total_vulnerabilities }

GET/api/v1/survey/findingsPublic

List survey findings

Query parameters

NameTypeDescription
categorystring
algorithmstring
quantum_statusstring
sourcestring
target_idstring
qstringSubstring search over target name/ref, file path, and rationale.
snapshotstringISO timestamp from a prior summary's generated_at, to pin a consistent count.
sort"created_at" | "algorithm" | "category"
dir"asc" | "desc"
pageint
page_sizeint1–200, defaults to 50.
GET/api/v1/survey/findings/{finding_id}Public

Fetch one survey finding

GET/api/v1/survey/vulnerabilitiesPublic

List survey vulnerabilities

Query parameters

NameTypeDescription
severitystring
packagestring
sourcestring
target_idstring
qstring
snapshotstring
sort"created_at" | "package" | "severity"
dir"asc" | "desc"
pageint
page_sizeint
GET/api/v1/survey/vulnerabilities/{vulnerability_id}Public

Fetch one survey vulnerability

GET/api/v1/survey/targets/{target_id}Public

Fetch a survey target with all its findings and vulnerabilities