Policy Evaluations
1 operation under /v1/policy-evaluations (GET): parameters, status codes, refusal bodies, and the same request in curl, HTTP, Python and TypeScript.
Base URL: https://api.codespar.dev
Every operation below requires a Bearer token. See Authentication.
GET /v1/policy-evaluations
https://api.codespar.dev/v1/policy-evaluationsList policy evaluations, newest first. 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. limit is clamped at 100.
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
limit | integer | no | — |
Responses
| Status | Body | Description |
|---|---|---|
200 | array of PolicyEvaluation | OK |
curl -X GET https://api.codespar.dev/v1/policy-evaluations \
-H "Authorization: Bearer $CODESPAR_API_KEY"GET /v1/policy-evaluations HTTP/1.1
Host: api.codespar.dev
Authorization: Bearer $CODESPAR_API_KEYimport os
import requests
res = requests.get(
"https://api.codespar.dev/v1/policy-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/policy-evaluations", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.CODESPAR_API_KEY}`,
},
});
const data = await res.json();const result = await cs.api.get("/v1/policy-evaluations");[
{
"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
}
]Policies
6 operations under /v1/policies (GET POST PATCH DELETE): parameters, status codes, refusal bodies, and the same request in curl, HTTP, Python and TypeScript.
Evaluations
1 operation under /v1/evaluations (GET): parameters, status codes, refusal bodies, and the same request in curl, HTTP, Python and TypeScript.