curl --request GET \
--url https://{tenant}.earnie.dev/v1/self-checks \
--header 'Authorization: Bearer <token>'import requests
url = "https://{tenant}.earnie.dev/v1/self-checks"
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/self-checks', 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/self-checks",
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/self-checks"
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/self-checks")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenant}.earnie.dev/v1/self-checks")
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>"
},
"status": "running",
"coverage": "full",
"producer": "ui_upload",
"created_by": {
"kind": "user",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"created_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"files": {
"submitted": 1,
"included": 1,
"excluded": 1,
"preexisting_modified": [
"<string>"
]
},
"scanners": [
{
"scanner": "oss",
"ran": true,
"reason": "not_enabled"
}
],
"evaluated": {
"policies": 123,
"detections": 123
},
"not_evaluated": [
{
"policy": {
"id": 123,
"name": "<string>",
"revision": "<string>"
},
"reason": "<string>",
"detail": "<string>"
}
],
"violations": [
{
"policy": {
"id": 123,
"name": "<string>",
"revision": "<string>"
},
"verdict": "block",
"findings": [
{
"path": "<string>",
"kind": "<string>",
"summary": "<string>",
"line": 123,
"evidence_ref": "<string>"
}
],
"remediation": {
"tier": "A",
"summary": "<string>",
"prompt": "<string>"
}
}
],
"url": "<string>",
"name": "<string>",
"gate": "pass",
"finished_at": "2023-11-07T05:31:56Z",
"files_total": 123,
"error_code": "<string>",
"error_message": "<string>"
}
],
"total": 123
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}List Self-checks
Self-checks are listed here and nowhere else: GET /v1/scans returns governed Scans only, so a developer’s twenty commits a day never crowd out a Project’s scan history.
curl --request GET \
--url https://{tenant}.earnie.dev/v1/self-checks \
--header 'Authorization: Bearer <token>'import requests
url = "https://{tenant}.earnie.dev/v1/self-checks"
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/self-checks', 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/self-checks",
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/self-checks"
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/self-checks")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenant}.earnie.dev/v1/self-checks")
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>"
},
"status": "running",
"coverage": "full",
"producer": "ui_upload",
"created_by": {
"kind": "user",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"created_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"files": {
"submitted": 1,
"included": 1,
"excluded": 1,
"preexisting_modified": [
"<string>"
]
},
"scanners": [
{
"scanner": "oss",
"ran": true,
"reason": "not_enabled"
}
],
"evaluated": {
"policies": 123,
"detections": 123
},
"not_evaluated": [
{
"policy": {
"id": 123,
"name": "<string>",
"revision": "<string>"
},
"reason": "<string>",
"detail": "<string>"
}
],
"violations": [
{
"policy": {
"id": 123,
"name": "<string>",
"revision": "<string>"
},
"verdict": "block",
"findings": [
{
"path": "<string>",
"kind": "<string>",
"summary": "<string>",
"line": 123,
"evidence_ref": "<string>"
}
],
"remediation": {
"tier": "A",
"summary": "<string>",
"prompt": "<string>"
}
}
],
"url": "<string>",
"name": "<string>",
"gate": "pass",
"finished_at": "2023-11-07T05:31:56Z",
"files_total": 123,
"error_code": "<string>",
"error_message": "<string>"
}
],
"total": 123
}{
"code": "<string>",
"message": "<string>"
}{
"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 ids to filter by.
A Self-check's lifecycle, collapsed from the underlying run's status. running covers every non-terminal state: the caller polls, or the creation call returned past its synchronous budget.
There is no cancelled here: a cancelled run reports failed. The receiving-idle sweep cancels a Self-check whose client stopped uploading, and running would never resolve.
running, completed, failed Free-text substring search, case-insensitive, across violation and not_evaluated policy names, detection paths, detection summaries, and (in addition, not exclusively) the run's name. Empty or absent applies no filter.
128Comma-separated SelfCheckGate values to filter by. A running run's null gate never matches an explicit value here.
Comma-separated producers to filter by. Only pre_commit and mcp are Self-check producers; any other value is rejected with invalid_producer.
created_at, finished_at, expires_at, status, gate, producer asc, desc 1 <= x <= 200x >= 0