curl --request POST \
--url https://api.coval.dev/v1/simulations:rerunMetrics \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"simulation_ids": [
"4bgnvEcWRtj5HbtfEujWdT"
],
"metric_ids": [
"29BlkepvvX19ebbLDB0y6Q"
],
"dev_id": "loren"
}
'import requests
url = "https://api.coval.dev/v1/simulations:rerunMetrics"
payload = {
"simulation_ids": ["4bgnvEcWRtj5HbtfEujWdT"],
"metric_ids": ["29BlkepvvX19ebbLDB0y6Q"],
"dev_id": "loren"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
simulation_ids: ['4bgnvEcWRtj5HbtfEujWdT'],
metric_ids: ['29BlkepvvX19ebbLDB0y6Q'],
dev_id: 'loren'
})
};
fetch('https://api.coval.dev/v1/simulations:rerunMetrics', 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.coval.dev/v1/simulations:rerunMetrics",
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([
'simulation_ids' => [
'4bgnvEcWRtj5HbtfEujWdT'
],
'metric_ids' => [
'29BlkepvvX19ebbLDB0y6Q'
],
'dev_id' => 'loren'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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.coval.dev/v1/simulations:rerunMetrics"
payload := strings.NewReader("{\n \"simulation_ids\": [\n \"4bgnvEcWRtj5HbtfEujWdT\"\n ],\n \"metric_ids\": [\n \"29BlkepvvX19ebbLDB0y6Q\"\n ],\n \"dev_id\": \"loren\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.coval.dev/v1/simulations:rerunMetrics")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"simulation_ids\": [\n \"4bgnvEcWRtj5HbtfEujWdT\"\n ],\n \"metric_ids\": [\n \"29BlkepvvX19ebbLDB0y6Q\"\n ],\n \"dev_id\": \"loren\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coval.dev/v1/simulations:rerunMetrics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"simulation_ids\": [\n \"4bgnvEcWRtj5HbtfEujWdT\"\n ],\n \"metric_ids\": [\n \"29BlkepvvX19ebbLDB0y6Q\"\n ],\n \"dev_id\": \"loren\"\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"simulation_id": "4bgnvEcWRtj5HbtfEujWdT",
"error": "<string>"
}
],
"queued_count": 2,
"failed_count": 0
}{
"results": [
{
"simulation_id": "4bgnvEcWRtj5HbtfEujWdT",
"error": "<string>"
}
],
"queued_count": 2,
"failed_count": 0
}{
"error": {
"code": "INVALID_ARGUMENT",
"message": "Request validation failed",
"details": [
{
"field": "iteration_count",
"description": "Value must be between 1 and 10"
}
]
}
}{
"error": {
"code": "UNAUTHENTICATED",
"message": "Missing API Key",
"details": [
{
"field": "X-API-Key",
"description": "X-API-Key header is required"
}
]
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Agent not found",
"details": [
{
"field": "agent_id",
"description": "Agent 'gk3jK9mPq2xRt5vW8yZaBc' does not exist"
}
]
}
}{
"error": {
"code": "INTERNAL",
"message": "Internal server error",
"details": [
{
"description": "An unexpected error occurred. Please contact support."
}
]
}
}{
"error": {
"code": "INTERNAL",
"message": "Service temporarily unavailable",
"details": [
{
"description": "Database routing is temporarily unavailable. Please retry."
}
]
}
}Batch rerun metrics
Re-score a set of metrics against a set of existing simulations without re-running the simulations. The same metrics are applied to every simulation (metrics x simulations). Limits: up to 100 simulations, up to 500 metrics, and at most 500 total reruns (simulation_ids x metric_ids) per call. Best-effort per simulation: valid simulations are queued and a per-simulation status is returned. Existing metric results are overwritten when each rerun completes.
curl --request POST \
--url https://api.coval.dev/v1/simulations:rerunMetrics \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"simulation_ids": [
"4bgnvEcWRtj5HbtfEujWdT"
],
"metric_ids": [
"29BlkepvvX19ebbLDB0y6Q"
],
"dev_id": "loren"
}
'import requests
url = "https://api.coval.dev/v1/simulations:rerunMetrics"
payload = {
"simulation_ids": ["4bgnvEcWRtj5HbtfEujWdT"],
"metric_ids": ["29BlkepvvX19ebbLDB0y6Q"],
"dev_id": "loren"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
simulation_ids: ['4bgnvEcWRtj5HbtfEujWdT'],
metric_ids: ['29BlkepvvX19ebbLDB0y6Q'],
dev_id: 'loren'
})
};
fetch('https://api.coval.dev/v1/simulations:rerunMetrics', 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.coval.dev/v1/simulations:rerunMetrics",
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([
'simulation_ids' => [
'4bgnvEcWRtj5HbtfEujWdT'
],
'metric_ids' => [
'29BlkepvvX19ebbLDB0y6Q'
],
'dev_id' => 'loren'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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.coval.dev/v1/simulations:rerunMetrics"
payload := strings.NewReader("{\n \"simulation_ids\": [\n \"4bgnvEcWRtj5HbtfEujWdT\"\n ],\n \"metric_ids\": [\n \"29BlkepvvX19ebbLDB0y6Q\"\n ],\n \"dev_id\": \"loren\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.coval.dev/v1/simulations:rerunMetrics")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"simulation_ids\": [\n \"4bgnvEcWRtj5HbtfEujWdT\"\n ],\n \"metric_ids\": [\n \"29BlkepvvX19ebbLDB0y6Q\"\n ],\n \"dev_id\": \"loren\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coval.dev/v1/simulations:rerunMetrics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"simulation_ids\": [\n \"4bgnvEcWRtj5HbtfEujWdT\"\n ],\n \"metric_ids\": [\n \"29BlkepvvX19ebbLDB0y6Q\"\n ],\n \"dev_id\": \"loren\"\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"simulation_id": "4bgnvEcWRtj5HbtfEujWdT",
"error": "<string>"
}
],
"queued_count": 2,
"failed_count": 0
}{
"results": [
{
"simulation_id": "4bgnvEcWRtj5HbtfEujWdT",
"error": "<string>"
}
],
"queued_count": 2,
"failed_count": 0
}{
"error": {
"code": "INVALID_ARGUMENT",
"message": "Request validation failed",
"details": [
{
"field": "iteration_count",
"description": "Value must be between 1 and 10"
}
]
}
}{
"error": {
"code": "UNAUTHENTICATED",
"message": "Missing API Key",
"details": [
{
"field": "X-API-Key",
"description": "X-API-Key header is required"
}
]
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Agent not found",
"details": [
{
"field": "agent_id",
"description": "Agent 'gk3jK9mPq2xRt5vW8yZaBc' does not exist"
}
]
}
}{
"error": {
"code": "INTERNAL",
"message": "Internal server error",
"details": [
{
"description": "An unexpected error occurred. Please contact support."
}
]
}
}{
"error": {
"code": "INTERNAL",
"message": "Service temporarily unavailable",
"details": [
{
"description": "Database routing is temporarily unavailable. Please retry."
}
]
}
}Authorizations
API key for authentication.
Body
Simulation IDs (22-character ShortUUIDs) to re-score. Up to 100 per call.
1 - 100 elements22["4bgnvEcWRtj5HbtfEujWdT"]
Metric IDs (22-character ShortUUIDs) to run against every simulation. Up to 500 per call.
1 - 500 elements22["29BlkepvvX19ebbLDB0y6Q"]
Optional developer routing id; only applied when the endpoint runs in the dev environment (ignored in production).
"loren"
Was this page helpful?