Skip to content
GET/api/v1/security/{scanId}/export

Export a scan's findings as SARIF, HTML or JSON

Takes a scan's findings out of the dashboard and puts them where the work happens: a SARIF 2.1.0 log that uploads straight into GitHub Code Scanning, a single self-contained HTML report that opens offline with no EvalGuard account, or raw JSON. Rendered by the same `@evalguard/core` exporters the CLI and the CI action use, so an artifact downloaded here is byte-for-byte the same shape as one produced in a pipeline. Findings are rebuilt into the canonical shape including the `errored` flag — without it a scan that never reached the target would export as a clean bill of health. Authorization mirrors GET /api/v1/security/{scanId}: resolve scan → project → org, then require org membership. A scan that cannot be resolved to an org returns 404, not 403 — an unverifiable scan must not be confirmed to exist. Every export is audit-logged (action `export`) with the format and the finding count, never the payloads, because an export moves raw attack payloads and raw model responses out of the platform.

Authentication

Send Authorization: Bearer YOUR_API_KEY on every request. Generate API keys at /dashboard/settings/api-keys.

Parameters

scanId in pathrequired

Scan to export. Non-UUID input is rejected with 400 INVALID_ID before any lookup.

string
format in query

Output format. Absent or empty defaults to `sarif`; any other value is 400 INVALID_FORMAT.

string

Response

200 example

{}

All status codes

200The exported report, served as an attachment.
400(no description)
401(no description)
403NOT_ORG_MEMBER — you are not a member of the organization that owns this scan.
404(no description)
429(no description)
500Internal Server Error — DB_ERROR.

Code samples

cURL

# {scanId} is shown with an EXAMPLE value — replace it with real values.
curl -X GET \
  https://evalguard.ai/api/v1/security/00000000-0000-0000-0000-000000000000/export \
  -H "Authorization: Bearer $EVALGUARD_API_KEY"

TypeScript

// The TypeScript SDK (@evalguard/sdk) exposes TYPED methods — runEval,
// getEval, runSecurityScan, checkFirewall, … — not a generic request().
// For an arbitrary endpoint, call it directly:
// {scanId} is shown with an EXAMPLE value — replace it with real values.

const res = await fetch("https://evalguard.ai/api/v1/security/00000000-0000-0000-0000-000000000000/export", {
  method: "GET",
  headers: { Authorization: `Bearer ${process.env.EVALGUARD_API_KEY}` },
});
console.log(res.status, await res.json());

Python

# The Python SDK (pip install evalguardai) exposes TYPED methods on
# EvalGuardClient — run_eval, get_eval, … — not a generic request().
# For an arbitrary endpoint, call it directly:
# {scanId} is shown with an EXAMPLE value — replace it with real values.

import os
import requests

headers = {"Authorization": f"Bearer {os.environ['EVALGUARD_API_KEY']}"}

response = requests.request("GET", "https://evalguard.ai/api/v1/security/00000000-0000-0000-0000-000000000000/export", headers=headers)
print(response.status_code, response.json())

Go

package main

import (
	"context"
	"fmt"
	"net/http"
	"os"
)

// {scanId} is shown with an EXAMPLE value — replace it with real values.
func main() {
	req, _ := http.NewRequestWithContext(context.Background(), "GET", "https://evalguard.ai/api/v1/security/00000000-0000-0000-0000-000000000000/export", nil)
	req.Header.Set("Authorization", "Bearer "+os.Getenv("EVALGUARD_API_KEY"))
	resp, err := http.DefaultClient.Do(req)
	if err != nil { panic(err) }
	defer resp.Body.Close()
	fmt.Println(resp.Status)
}

Errors

400401403404429500

Other Security endpoints