This document defines the external HTTP APIs expected by DTVP for the optional integrations.
DTVP expects the TMRescore backend to expose the following endpoints under its configured base URL (DTVP_TMRESCORE_URL):
-
GET /health- Returns service health and optional configuration status.
-
POST /api/v1/sessions- Create a new analysis session.
- Request body: JSON with
application_name,application_version, and optionalsession_id.
-
POST /api/v1/sessions/{session_id}/inventory- One-shot upload + analysis endpoint.
- Multipart form data with
threatmodel,sbom, optionalitems_csv, optionalconfig, and query flags.
-
GET /api/v1/sessions/{session_id}/results- Retrieve the final analysis result summary.
-
GET /api/v1/sessions/{session_id}/results/json- Retrieve the raw JSON result document.
-
GET /api/v1/sessions/{session_id}/results/vex- Download the CycloneDX VEX output.
-
GET /api/v1/sessions/{session_id}/outputs/{filename}- Download any generated output artifact.
-
GET /api/v1/sessions/{session_id}/progress- Poll the analysis progress state while an analysis is running.
-
GET /api/v1/sessions/{session_id}/results- Returns an
AnalysisResultobject with at least:session_id— stringstatus—completedorfailedtotal_cves— integerrescored_count— integeravg_score_reduction— numberelapsed_seconds— numberoutputs— object mapping output names to download URLserror— string or null when status isfailed
- Returns an
-
GET /api/v1/sessions/{session_id}/results/json- Returns the complete raw analysis payload produced by TMRescore.
- Expected to include the session context, proposal details, per-CVE rescoring information, and any internal scoring metadata needed by the DTVP backend.
-
GET /api/v1/sessions/{session_id}/progress- Returns a progress snapshot containing:
percent— integer progress percentagecompleted_steps— integertotal_steps— integercurrent_step— string or nullcurrent_title— string or nullcurrent_agent— string or nullcurrent_activity— string or nulllast_updated_at— timestamp or nullactive_agents— array of active step objectsstep_statuses— object mapping step names to status strings
- Returns a progress snapshot containing:
- Static OpenAPI specifications for the integrations are available in
openapi/. - TMRescore has a static spec at
openapi/tmrescore-openapi.json. - Code Analysis has a static spec at
openapi/code-analysis-openapi.json. - In the mock environment, both service mocks expose a dynamic OpenAPI definition at
/openapi.json.
DTVP expects the Code Analysis backend to expose the following endpoints under its configured base URL (DTVP_CODE_ANALYSIS_URL):
The repository includes Agentyzer under agentyzer/ as the first-party implementation of this API. Docker Compose starts it as service agentyzer and points DTVP at http://agentyzer:8000 by default.
-
GET /health- Returns service readiness and health.
- Expected response:
{ "status": "ok" }. - May also include model/LLM metadata such as
model,llm_backend,llm_provider, or a nestedllmobject. - May include
configurationandbackendobjects. DTVP promotes these into/api/code-analysis/statusso the dashboard can show analyzer config paths, repository workspace/counts, enabled features, LLM host/provider/model health, repository backend strategy, job-store details, and execution slot availability.
-
POST /assess- Start an assessment.
- Request body: JSON with at least
component_name; optionalvuln_id,cvss_vector,user_guidance,model,llm_backend,llm_provider,focus_path,dependency_paths, anddebug. - Default behavior is asynchronous: the response is a job handle.
- Expected async response:
job_id— stringstatus—pendingpoll_url— relative URL to poll for job status- Optional model/LLM metadata (
model,llm_backend,llm_provider, orllm) is preserved by DTVP when present. - Optional
configurationandbackendobjects are preserved for dashboard display.
-
POST /assess?sync=true- Start a synchronous assessment and return the finished result in the response.
- Expected sync response: an
AssessResponseobject containing:assessment— anAssessmentobject with top-level verdict metadata.steps— an ordered array ofStepFindings.
-
POST /benchmark/compare- Compare a human assessment artifact with a saved automated assessment result.
- This endpoint evaluates assessment artifacts only; it must not rerun repository or source analysis.
- DTVP sends a prepared
benchmarkobject with normalized human/automated fields and deterministic state/CVSS deltas. - Expected response keeps the benchmark shape and includes
comparison_method,evaluator, canonical 1-5rating,findings, andrecommendation. - If the LLM evaluator is unavailable, return a deterministic fallback response with
evaluator.probabilistic=false.
-
GET /jobs- List jobs known to the analyzer process.
- Expected response:
{ "jobs": [...], "configuration": {...}, "backend": {...} }, where each item follows theJobStatusResponseshape. - Shared
configurationandbackendmetadata should be returned once on the response envelope, not repeated on every job. Individual jobs should carry job-specific request, progress, log, and LLM metadata. backend.jobsshould includejob_store,execution_model,known_jobs,status_counts,max_concurrent_jobs,running_jobs,queued_jobs, andavailable_slotswhen known.
-
GET /jobs/{job_id}- Fetch the status of a previously created job.
- Expected response: a
JobStatusResponseobject containing:job_id,status,created_at,finished_at,error.progress— aJobProgressobject.- Optional model/LLM metadata (
model,llm_backend,llm_provider,llm), optionalconfiguration/backendobjects, and optional log output (logs,events, ormessages).
statusis usuallypending,running,completed,failed, orcancelled.
-
GET /jobs/{job_id}/result- Fetch the final result of a completed asynchronous job.
- Expected response: an
AssessResponseobject identical in structure to the sync response.
-
DELETE /jobs/{job_id}- Cancel a pending/running job or remove a finished job.
- Expected response:
204 No Contenton success. - Cancellation is best effort for a running job. If the analyzer cannot stop a running job, return a non-2xx response with
{ "detail": "..." }; DTVP will keep its queue item running and surface the refusal.
-
AssessResponse- Must contain:
assessmentsteps
assessmentshould include at least:affected— booleanverdict— stringconfidence— stringexposure— stringsummary— stringreasoning— stringanalysis— VEX-style analysis state (e.g.EXPLOITABLE,NOT_AFFECTED)justification— analysis justificationdetails— human-readable rationalecvss_vector— string or nullcvss_score— number or null
- Optionally includes:
advisory_relevanceversion_analysisremediation_viewaudit_viewadjusted_cvss
- Must contain:
-
StepFindings- Each step object should include:
step— stable step identifiertitle— human-readable namestatus— step status such aspass,fail, orskipfindings— structured step-specific metadataevidence— array of strings
- Each step object should include:
-
JobStatusResponse.progress- Must contain:
percent— integer 0–100completed_steps— integertotal_steps— integer
- May also include:
current_step,current_title,current_agent,current_activitylast_completed_steplast_updated_atactive_agents— array of active step objectsstep_statuses— map of step name to status stringlogs,events, ormessages— optional live log entries; entries may be strings or objects containing fields such astimestamp,level, andmessage
- Must contain:
-
JobSubmittedResponse- Must contain:
job_idstatuspoll_url
- Must contain:
-
Error responses
- Standard error response shape is
{ "detail": "..." }.
- Standard error response shape is
- A static OpenAPI specification for Code Analysis is available at
openapi/code-analysis-openapi.json. - The expected Code Analysis API surface is also implemented by the mock service in
test_setup/mock_code_analysis.py. - In the mock environment, Code Analysis exposes a dynamic OpenAPI definition at
/openapi.json.