Authentication
Use the same token patterns across the public API:
- Send the token as
Authorization: Bearer <token>. - Or send it through Basic auth with the token as the password.
For Basic auth, use the robot ID as the username when you have one. If your robot account ID is my-robot, use my-robot as the username and the token as the password. The placeholder __token__ also works, but the robot ID is easier to identify later.
Username: my-robot
Password: <token>
For token setup and rotation in the Robot accounts tab, see Create a robot account and use its token.
OpenAPI files
Download the current machine-readable contract directly:
Endpoint overview
Expand an endpoint to inspect a minimal request example and open the full contract when you need request and response details.
/api/artifacts/search/
Resolve package artifact IDs
curl \
-H "Authorization: Bearer $CRAFTIFACT_TOKEN" \
"https://packages.example.com/api/artifacts/search/?repository=libs-release&format=maven&group_id=com.example&name=demo&version=1.2.3"
/api/sbom/upload/
Upload a CycloneDX JSON SBOM
curl \
-X POST \
-H "Authorization: Bearer $CRAFTIFACT_TOKEN" \
-H "Content-Type: application/json" \
--data-binary @dist/example-cyclonedx.json \
"https://packages.example.com/api/sbom/upload/?artifact_id=ARTIFACT_ID"
/api/sbom/vulnerabilities/report/
Read the effective SBOM vulnerability report for one subject
curl \
-H "Authorization: Bearer $CRAFTIFACT_TOKEN" \
"https://packages.example.com/api/sbom/vulnerabilities/report/?repository=libs-release&artifact_id=ARTIFACT_ID"
/api/evidence/snapshots/
Create an 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/"
/api/evidence/snapshots/
List evidence snapshots
curl \
-H "Authorization: Bearer $CRAFTIFACT_TOKEN" \
"https://packages.example.com/api/evidence/snapshots/"
/api/evidence/snapshots/{snapshot_id}/
Read an evidence snapshot
curl \
-H "Authorization: Bearer $CRAFTIFACT_TOKEN" \
"https://packages.example.com/api/evidence/snapshots/SNAPSHOT_ID/"
/api/evidence/snapshots/{snapshot_id}/export/
Export an evidence snapshot
curl \
-H "Authorization: Bearer $CRAFTIFACT_TOKEN" \
-o evidence-snapshot.zip \
"https://packages.example.com/api/evidence/snapshots/SNAPSHOT_ID/export/"