Skip to main content

Evaluations

1 operation under /v1/evaluations (GET): parameters, status codes, refusal bodies, and the same request in curl, HTTP, Python and TypeScript.

1 min read
View MarkdownEdit on GitHub

Base URL: https://api.codespar.dev

Every operation below requires a Bearer token. See Authentication.

GET /v1/evaluations

GEThttps://api.codespar.dev/v1/evaluations
Deprecated

Deprecated alias of GET /v1/policy-evaluations (ent#979), kept for two releases. Same handler, same required scope; switch the path and nothing else changes. An API key or OAuth token reads the evaluations of its own project only. An evaluation recorded without a project (the history from before 2026-10-03, and org-level evaluations) is returned to service auth only. With service auth the answer covers the whole organization and the x-codespar-project header does not narrow it: projectId on each row is what a client filters on.

Query parameters

NameTypeRequiredDescription
limitintegerno—

Responses

StatusBodyDescription
200array of PolicyEvaluationOK
Example request
curl -X GET https://api.codespar.dev/v1/evaluations \
  -H "Authorization: Bearer $CODESPAR_API_KEY"
GET /v1/evaluations HTTP/1.1
Host: api.codespar.dev
Authorization: Bearer $CODESPAR_API_KEY
import os
import requests

res = requests.get(
    "https://api.codespar.dev/v1/evaluations",
    headers={"Authorization": f"Bearer {os.environ['CODESPAR_API_KEY']}"},
)
res.raise_for_status()
data = res.json()
const res = await fetch("https://api.codespar.dev/v1/evaluations", {
  method: "GET",
  headers: {
    Authorization: `Bearer ${process.env.CODESPAR_API_KEY}`,
  },
});

const data = await res.json();
const result = await cs.api.get("/v1/evaluations");
Example response 200
application/json
[
  {
    "id": "policyevaluation_0000000000000000",
    "projectId": "prj_0000000000000000",
    "timestamp": "2026-01-15T12:00:00.000Z",
    "agentId": "agt_0000000000000000",
    "toolName": "Example",
    "ruleName": "Example",
    "ruleId": "rule_0000000000000000",
    "decision": "allow",
    "denialReason": "string",
    "approvalId": "approval_0000000000000000",
    "decidedAt": "2026-01-15T12:00:00.000Z",
    "decidedBy": "string",
    "estimatedCost": 0
  }
]
Evaluations | CodeSpar