Platform Endpoints
Evaluate Run
Complete a run and evaluate against test assertions
POST
/
api
/
platform
/
evaluateRun
Evaluate Run
curl --request POST \
--url https://api.example.com/api/platform/evaluateRun \
--header 'Content-Type: application/json' \
--data '
{
"runId": "<string>"
}
'import requests
url = "https://api.example.com/api/platform/evaluateRun"
payload = { "runId": "<string>" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({runId: '<string>'})
};
fetch('https://api.example.com/api/platform/evaluateRun', 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://api.example.com/api/platform/evaluateRun",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'runId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/platform/evaluateRun"
payload := strings.NewReader("{\n \"runId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/platform/evaluateRun")
.header("Content-Type", "application/json")
.body("{\n \"runId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/platform/evaluateRun")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"runId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"runId": "<string>",
"status": "<string>",
"passed": true,
"score": {},
"failures": [
{}
]
}Request
POST /api/platform/evaluateRun
Body Parameters
Run ID from
startRunExample Request
curl -X POST https://api.agentdiff.dev/api/platform/evaluateRun \
-H "X-API-Key: ad_live_sk_..." \
-H "Content-Type: application/json" \
-d '{
"runId": "run-xyz789"
}'
Response
Run identifier
Final status:
"passed" or "failed"Whether all assertions passed
Score details
List of failed assertions with details
Example Response (Passed)
{
"runId": "run-xyz789",
"status": "passed",
"passed": true,
"score": {
"passed": 2,
"total": 2,
"percent": 100.0
},
"failures": []
}
Example Response (Failed)
{
"runId": "run-xyz789",
"status": "failed",
"passed": false,
"score": {
"passed": 1,
"total": 2,
"percent": 50.0
},
"failures": [
"assertion#2 messages expected count 1 but got 0"
]
}
What Happens
- After snapshot: Current database state is captured
- Diff computed: Before/after states compared
- Assertions evaluated: Test assertions checked against diff
- Results stored: Results saved for later retrieval
- Replication stopped: WAL capture ends
Use this when you have a test with assertions. For just getting the diff without assertions, use
diffRun instead.Errors
| Error | Status | Description |
|---|---|---|
run_not_found | 404 | Run doesn’t exist |
run_already_completed | 400 | Run already evaluated |
no_test_defined | 400 | No test associated with this run |
SDK Usage
result = client.evaluate_run(runId=run.runId)
print(f"Passed: {result.passed}")
print(f"Score: {result.score['percent']}%")
if result.failures:
for f in result.failures:
print(f" Failed: {f}")
const result = await client.evaluateRun({ runId: run.runId });
console.log(`Passed: ${result.passed}`);
console.log(`Score: ${result.score.percent}%`);
if (result.failures) {
result.failures.forEach(f => console.log(` Failed: ${f}`));
}
⌘I
Evaluate Run
curl --request POST \
--url https://api.example.com/api/platform/evaluateRun \
--header 'Content-Type: application/json' \
--data '
{
"runId": "<string>"
}
'import requests
url = "https://api.example.com/api/platform/evaluateRun"
payload = { "runId": "<string>" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({runId: '<string>'})
};
fetch('https://api.example.com/api/platform/evaluateRun', 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://api.example.com/api/platform/evaluateRun",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'runId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/platform/evaluateRun"
payload := strings.NewReader("{\n \"runId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/platform/evaluateRun")
.header("Content-Type", "application/json")
.body("{\n \"runId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/platform/evaluateRun")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"runId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"runId": "<string>",
"status": "<string>",
"passed": true,
"score": {},
"failures": [
{}
]
}