/api/v1/evals/{runId}/exportDownload an eval run as a formatted file
Downloads the eval-run results in one of five formats (?format=json|csv|html|human-eval|junit, default json; anything else is 400 INVALID_FORMAT). Maps the stored eval_runs row + its eval_cases (ordered by case_index) back into the EvalOutput shape and dispatches to the matching @evalguard/core formatter. Access is enforced in code, not by RLS: the handler resolves the run's project → org and requires an org_members row for the caller (404 if the run does not exist, 403 NOT_ORG_MEMBER otherwise); the read runs on the service-role client for API-key callers, so RLS does not apply there. Returns a `Content-Disposition: attachment` response with filename `evalguard-<first 8 chars of runId>.<ext>` and `Cache-Control: private, no-store`.
Authentication
Send Authorization: Bearer YOUR_API_KEY on every request. Generate API keys at /dashboard/settings/api-keys.
Parameters
runId in pathrequiredstringformat in queryrequiredOutput format. `json` is machine-readable; `csv` is spreadsheet-friendly; `html` is a standalone shareable summary; `human-eval` is a YAML reviewer workbook; `junit` is JUnit XML for CI integration.
stringResponse
All status codes
Code samples
cURL
# {runId} is shown with an EXAMPLE value — replace it with real values.
curl -X GET \
https://evalguard.ai/api/v1/evals/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:
// {runId} is shown with an EXAMPLE value — replace it with real values.
const res = await fetch("https://evalguard.ai/api/v1/evals/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:
# {runId} 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/evals/00000000-0000-0000-0000-000000000000/export", headers=headers)
print(response.status_code, response.json())Go
package main
import (
"context"
"fmt"
"net/http"
"os"
)
// {runId} is shown with an EXAMPLE value — replace it with real values.
func main() {
req, _ := http.NewRequestWithContext(context.Background(), "GET", "https://evalguard.ai/api/v1/evals/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)
}