curl --request GET \
--url https://{tenant}.earnie.dev/v1/scans/{scanId}/audit \
--header 'Authorization: Bearer <token>'import requests
url = "https://{tenant}.earnie.dev/v1/scans/{scanId}/audit"
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/{scanId}/audit', 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/{scanId}/audit",
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/{scanId}/audit"
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/{scanId}/audit")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenant}.earnie.dev/v1/scans/{scanId}/audit")
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{
"scan_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"events": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"event_type": "<string>",
"actor": {
"kind": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"display": "<string>"
},
"occurred_at": "2023-11-07T05:31:56Z",
"payload": {}
}
]
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}The Scan's Audit Trail
Returns the Scan’s full, oldest-first Audit Trail: every audit event whose subject is this Scan — submission (scan.submitted), the gate it was given (scan.gate_evaluated), later Approval overlays (scan.gate_updated), and its provider publications (publication.*) — so anyone with scans:read can answer “which code, policy, actor and outcome produced this gate”.
actor.display is the identity frozen at emit time; it is never re-resolved.
A Scan that exists but pre-dates subject-addressed emission answers an empty events array, not a 404. A Self-check is not a Scan and answers 404 here; its decision log is read through GET /v1/audit/events?subject_kind=selfcheck.
curl --request GET \
--url https://{tenant}.earnie.dev/v1/scans/{scanId}/audit \
--header 'Authorization: Bearer <token>'import requests
url = "https://{tenant}.earnie.dev/v1/scans/{scanId}/audit"
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/{scanId}/audit', 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/{scanId}/audit",
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/{scanId}/audit"
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/{scanId}/audit")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenant}.earnie.dev/v1/scans/{scanId}/audit")
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{
"scan_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"events": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"event_type": "<string>",
"actor": {
"kind": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"display": "<string>"
},
"occurred_at": "2023-11-07T05:31:56Z",
"payload": {}
}
]
}{
"code": "<string>",
"message": "<string>"
}{
"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.