Skip to content

Evidence snapshots API

Reference for creating, reading, and exporting technical evidence snapshots for explicit package artifact and OCI subject sets.

POST /api/evidence/snapshots/

Purpose

  • freeze one explicit set of package artifacts and OCI subjects
  • capture compact SBOM, vulnerability, license, suppression, policy-decision, and provenance summary values
  • give automation a stable technical review record without exporting a compliance package

Request

Send name and at least one subject. Each subject must include repository and exactly one selector.

Package artifact subject

  • artifact_id: existing package artifact ID

OCI subject

  • oci_digest: existing visible OCI manifest or index digest

For least privilege, snapshot creation requires current package artifact read access, composition read access for SBOM data, findings read access, license-policy read access, pull-gate inspect access, and token scope for every referenced repository family. Existing findings-suppress or license-policy configure permissions also satisfy the corresponding visibility checks, but they are not needed for read-only evidence collection.

capture_options defaults to omitting privileged suppression details. Set include_suppression_actor_rationale to include suppression created_by and justification, and set include_suppression_scope_details to include scope_key and scope_label. Either option requires findings:suppress on every selected repository. Included values are frozen into the snapshot and become visible to anyone who can later read or download that snapshot.

JSON payload

Required
name Required

string

Human-readable snapshot name.
description Optional

string

Optional operator note for the reviewed technical scope.
subjects Required

array

Explicit artifact and OCI subject set to freeze.
capture_options Optional

object

Capture-time options for privileged suppression fields. Omitted options default to false.
Example JSON
{
  "name": "Release 1.0 review",
  "description": "Technical review inputs for release 1.0.",
  "capture_options": {
    "include_suppression_actor_rationale": false,
    "include_suppression_scope_details": false
  },
  "subjects": [
    {
      "repository": "libs-release",
      "artifact_id": "4fd75091-2d3a-48b7-9e35-85a5edfa1d92"
    },
    {
      "repository": "containers",
      "oci_digest": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
    }
  ]
}

Create Responses

Common status codes:

  • 201 Created: the snapshot was created and returned with captured subjects.
  • 400 Bad Request: the subject set is empty, duplicated, too large, or uses invalid selectors.
  • 401 Unauthorized: no valid programmatic credentials were provided.
  • 403 Forbidden: the caller can access the repository but lacks one required evidence summary permission.
  • 404 Not Found: a repository or selected subject cannot be resolved or is hidden by repository read access or token scope.
201

Created

Evidence snapshot created.
id Required

string · uuid

name Required

string

description Required

string

scope_kind Required

string · enum: explicit_subject_set

created_by Required

string

created_at Required

string · date-time

modified_at Required

string · date-time

subject_count Required

integer

repositories Required

array

subjects Required

array

400

Bad Request

Bad request. Typical causes include:

  • name is missing.
  • subjects is empty or exceeds the configured subject limit.
  • a subject omits repository.
  • a subject provides neither or both selectors.
  • duplicate subject keys were provided.
  • description exceeds the configured length limit.
error Required

string

Human-readable error message for the rejected upload.
401

Unauthorized

Authentication failed or no programmatic credentials were provided.
error Required

string

Human-readable error message for the rejected upload.
403

Forbidden

The caller can access the repository but lacks one required evidence summary permission for at least one subject.
error Required

string

Human-readable error message for the rejected upload.
404

Not Found

At least one repository or subject selector does not resolve to an accessible target.
error Required

string

Human-readable error message for the rejected upload.

List Snapshots

GET /api/evidence/snapshots/

List returns only snapshots where the caller can still access every captured repository. Partially inaccessible snapshots are omitted instead of exposing their existence. Snapshots can remain visible when a captured artifact or OCI subject is no longer live, as long as the captured repository is still accessible.

Name Required Type
limit Optional integer
offset Optional integer
200

OK

Evidence snapshots visible to the caller.
results Required

array

total Required

integer

limit Required

integer

offset Required

integer

400

Bad Request

Invalid pagination parameters.
error Required

string

Human-readable error message for the rejected upload.
401

Unauthorized

Authentication failed or no programmatic credentials were provided.
error Required

string

Human-readable error message for the rejected upload.

Read Snapshot

GET /api/evidence/snapshots/{snapshot_id}/

Use the snapshot ID from create or list responses. The response contains the captured subjects and summary values frozen at creation time. Those frozen values remain readable even if the original artifact, tag, manifest, or index is later deleted, hidden, untagged, or otherwise unavailable. Live detail links are available only while the source subject can still be resolved.

Name Required Type
snapshot_id Required string · uuid
200

OK

Evidence snapshot detail.
id Required

string · uuid

name Required

string

description Required

string

scope_kind Required

string · enum: explicit_subject_set

created_by Required

string

created_at Required

string · date-time

modified_at Required

string · date-time

subject_count Required

integer

repositories Required

array

subjects Required

array

401

Unauthorized

Authentication failed or no programmatic credentials were provided.
error Required

string

Human-readable error message for the rejected upload.
404

Not Found

The snapshot does not exist or is not fully visible to the caller.
error Required

string

Human-readable error message for the rejected upload.

Export Snapshot

GET /api/evidence/snapshots/{snapshot_id}/export/

Use export when you need a portable copy of the snapshot bundle. The ZIP contains manifest.json with SHA-256 hashes, evidence.json with the captured snapshot payload, summary.md with a concise Markdown summary, and per-subject subjects/<subject-id>/vulnerabilities.json and subjects/<subject-id>/suppressions.json detail files. Craftifact uses the frozen snapshot values and does not recompute live SBOM, vulnerability, license, suppression, policy-decision, or provenance state while exporting. Exports stay based on captured values even when the source subject is no longer available. If privileged suppression fields were included at capture time, the exported detail files include those frozen values even for later viewers who only have read access to the snapshot.

Name Required Type
snapshot_id Required string · uuid
200

OK

ZIP evidence bundle.
401

Unauthorized

Authentication failed or no programmatic credentials were provided.
error Required

string

Human-readable error message for the rejected upload.
404

Not Found

The snapshot does not exist or is not fully visible to the caller.
error Required

string

Human-readable error message for the rejected upload.

Examples

curl: create evidence snapshot
curl \
  -X POST \
  -H "Authorization: Bearer $CRAFTIFACT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"Release 1.0 review","subjects":[{"repository":"libs-release","artifact_id":"ARTIFACT_ID"},{"repository":"containers","oci_digest":"sha256:DIGEST"}]}' \
  "https://packages.example.com/api/evidence/snapshots/"
curl: list evidence snapshots
curl \
  -H "Authorization: Bearer $CRAFTIFACT_TOKEN" \
  "https://packages.example.com/api/evidence/snapshots/"
curl: read evidence snapshot
curl \
  -H "Authorization: Bearer $CRAFTIFACT_TOKEN" \
  "https://packages.example.com/api/evidence/snapshots/SNAPSHOT_ID/"
curl: export evidence snapshot
curl \
  -H "Authorization: Bearer $CRAFTIFACT_TOKEN" \
  -o evidence-snapshot.zip \
  "https://packages.example.com/api/evidence/snapshots/SNAPSHOT_ID/export/"

Boundaries

An evidence snapshot is a technical review record. It does not assert legal compliance, conformity assessment status, CE marking, statutory reporting status, or final release acceptance.