List scans
curl --request GET \
--url https://{tenant}.earnie.dev/v1/scans \
--header 'Authorization: Bearer <token>'import requests
url = "https://{tenant}.earnie.dev/v1/scans"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{tenant}.earnie.dev/v1/scans', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{tenant}.earnie.dev/v1/scans",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{tenant}.earnie.dev/v1/scans"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{tenant}.earnie.dev/v1/scans")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenant}.earnie.dev/v1/scans")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"items": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"slug": "<string>",
"name": "<string>"
},
"name": "<string>",
"status": "pending",
"archive_filename": "<string>",
"archive_sha256": "<string>",
"archive_size_bytes": 123,
"source_ref": "<string>",
"files_total": 123,
"files_scanned": 123,
"matches_total": 123,
"crypto_observations_available": true,
"created_by": {
"kind": "user",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"created_at": "2023-11-07T05:31:56Z",
"intent_hash": "<string>",
"reused": true,
"rerun_of": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cancellation_reason": "superseded",
"superseded_by_scan_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"triggers": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"scan_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"outcome": "created",
"producer": "ui_upload",
"created_at": "2023-11-07T05:31:56Z"
}
],
"error_code": "<string>",
"error_message": "<string>",
"source_type": "upload",
"repo_full_name": "<string>",
"git_ref": "<string>",
"commit_sha": "<string>",
"result_ref": "<string>",
"crypto_diff_baseline": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"scanner_version": "<string>",
"scanner_api_url": "<string>",
"scanner_session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"started_at": "2023-11-07T05:31:56Z",
"finished_at": "2023-11-07T05:31:56Z",
"enrichments": [
"vulnerabilities"
],
"stages": [
{
"name": "<string>",
"state": "pending",
"items_processed": 123,
"items_total": 123,
"started_at": "2023-11-07T05:31:56Z",
"finished_at": "2023-11-07T05:31:56Z",
"warnings": [
"<string>"
]
}
],
"added_count": 123,
"persisted_count": 123,
"absent_count": 123,
"coverage": "full",
"result_scope": "project",
"scan_context": {
"producer": "ui_upload",
"coverage": "full",
"provider": "<string>",
"repository": {
"external_id": "<string>",
"full_name": "<string>"
},
"change_request": {
"number": 123,
"url": "<string>",
"base_sha": "<string>",
"head_sha": "<string>",
"base_ref": "<string>",
"head_ref": "<string>"
},
"commit_sha": "<string>",
"branch": "<string>",
"run": {
"ci_system": "<string>",
"url": "<string>",
"external_id": "<string>"
}
},
"effective": {
"scanners": [
"oss"
],
"enrichments": [
"vulnerabilities"
],
"coverage": "full",
"policy_snapshot": {
"policies": [
{
"policy_id": 123,
"revision": "<string>"
}
]
},
"fetch_lfs_models": true
},
"narrowed_from_request": [
{
"field": "coverage",
"requested": "<string>",
"effective": "<string>",
"reason": "<string>"
}
],
"gate": "pass",
"gate_reason": "no_policy_applies",
"evaluation": {
"status": "pending",
"policies_evaluated": 1,
"evaluated_at": "2023-11-07T05:31:56Z"
},
"codebase_divergence": {
"is_divergent": true,
"overlap_pct": 0.5,
"prior_components": 123
},
"publication": {
"state": "pending",
"targets": [
{
"revision": 123,
"target": "check",
"state": "pending",
"attempts": 123,
"provider_ref": "<string>",
"error_class": "retryable",
"last_error": "<string>",
"next_attempt_at": "2023-11-07T05:31:56Z",
"published_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
]
}
}
],
"total": 123
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}scans
List scans
GET
/
v1
/
scans
List scans
curl --request GET \
--url https://{tenant}.earnie.dev/v1/scans \
--header 'Authorization: Bearer <token>'import requests
url = "https://{tenant}.earnie.dev/v1/scans"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{tenant}.earnie.dev/v1/scans', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{tenant}.earnie.dev/v1/scans",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{tenant}.earnie.dev/v1/scans"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{tenant}.earnie.dev/v1/scans")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenant}.earnie.dev/v1/scans")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"items": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"slug": "<string>",
"name": "<string>"
},
"name": "<string>",
"status": "pending",
"archive_filename": "<string>",
"archive_sha256": "<string>",
"archive_size_bytes": 123,
"source_ref": "<string>",
"files_total": 123,
"files_scanned": 123,
"matches_total": 123,
"crypto_observations_available": true,
"created_by": {
"kind": "user",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"created_at": "2023-11-07T05:31:56Z",
"intent_hash": "<string>",
"reused": true,
"rerun_of": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cancellation_reason": "superseded",
"superseded_by_scan_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"triggers": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"scan_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"outcome": "created",
"producer": "ui_upload",
"created_at": "2023-11-07T05:31:56Z"
}
],
"error_code": "<string>",
"error_message": "<string>",
"source_type": "upload",
"repo_full_name": "<string>",
"git_ref": "<string>",
"commit_sha": "<string>",
"result_ref": "<string>",
"crypto_diff_baseline": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"scanner_version": "<string>",
"scanner_api_url": "<string>",
"scanner_session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"started_at": "2023-11-07T05:31:56Z",
"finished_at": "2023-11-07T05:31:56Z",
"enrichments": [
"vulnerabilities"
],
"stages": [
{
"name": "<string>",
"state": "pending",
"items_processed": 123,
"items_total": 123,
"started_at": "2023-11-07T05:31:56Z",
"finished_at": "2023-11-07T05:31:56Z",
"warnings": [
"<string>"
]
}
],
"added_count": 123,
"persisted_count": 123,
"absent_count": 123,
"coverage": "full",
"result_scope": "project",
"scan_context": {
"producer": "ui_upload",
"coverage": "full",
"provider": "<string>",
"repository": {
"external_id": "<string>",
"full_name": "<string>"
},
"change_request": {
"number": 123,
"url": "<string>",
"base_sha": "<string>",
"head_sha": "<string>",
"base_ref": "<string>",
"head_ref": "<string>"
},
"commit_sha": "<string>",
"branch": "<string>",
"run": {
"ci_system": "<string>",
"url": "<string>",
"external_id": "<string>"
}
},
"effective": {
"scanners": [
"oss"
],
"enrichments": [
"vulnerabilities"
],
"coverage": "full",
"policy_snapshot": {
"policies": [
{
"policy_id": 123,
"revision": "<string>"
}
]
},
"fetch_lfs_models": true
},
"narrowed_from_request": [
{
"field": "coverage",
"requested": "<string>",
"effective": "<string>",
"reason": "<string>"
}
],
"gate": "pass",
"gate_reason": "no_policy_applies",
"evaluation": {
"status": "pending",
"policies_evaluated": 1,
"evaluated_at": "2023-11-07T05:31:56Z"
},
"codebase_divergence": {
"is_divergent": true,
"overlap_pct": 0.5,
"prior_components": 123
},
"publication": {
"state": "pending",
"targets": [
{
"revision": 123,
"target": "check",
"state": "pending",
"attempts": 123,
"provider_ref": "<string>",
"error_class": "retryable",
"last_error": "<string>",
"next_attempt_at": "2023-11-07T05:31:56Z",
"published_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
]
}
}
],
"total": 123
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}Authorizations
An Earnie API key, sent as Authorization: Bearer sk_earnie_.... Create one under Settings > API keys. The key's scopes decide which operations it may call.
Query Parameters
Comma-separated project UUIDs to filter scans by.
Lifecycle states:
pending— the scan exists; receiving its input has not started or finishedreceiving— the scan's input is being transferred (files, a repository, or an archive)extracting— an uploaded archive is being unpackedscanning— the scanners are runningimporting— an uploaded SBOM document is being read; SBOM imports skipreceivingandscanningcompleted— the scan finished and its results are availablefailed— terminal failure;error_codeanderror_messageare setcancelled— terminal cancellation; no findings, gate result, or posture is published
Available options:
pending, receiving, extracting, scanning, importing, completed, failed, cancelled Case-insensitive literal substring of scan name or archive filename. Also matches project name or slug among explicitly selected projects.
Maximum string length:
200Display bucket; running includes every nonterminal status, including pending. Combined with status when both are supplied.
Available options:
succeeded, running, failed, queued Required range:
1 <= x <= 200Required range:
x >= 0