curl --request POST \
--url https://api.coval.dev/v1/simulations/{simulation_id}/resimulate \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '{}'import requests
url = "https://api.coval.dev/v1/simulations/{simulation_id}/resimulate"
payload = {}
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({})
};
fetch('https://api.coval.dev/v1/simulations/{simulation_id}/resimulate', 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/{simulation_id}/resimulate",
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([
]),
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/{simulation_id}/resimulate"
payload := strings.NewReader("{}")
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/{simulation_id}/resimulate")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coval.dev/v1/simulations/{simulation_id}/resimulate")
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 = "{}"
response = http.request(request)
puts response.read_body{
"simulation_id": "4bgnvEcWRtj5HbtfEujWdT",
"run_id": "3zfmuDbVQsi4GaseDtiVcS",
"queued": true,
"message": "Simulation rerun queued. The latest database-backed versions of the agent, persona, test set, test case, metrics, and mutation config will be reloaded before execution, and the current simulation result will be overwritten."
}{
"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": "FAILED_PRECONDITION",
"message": "Simulation cannot be rerun",
"details": [
{
"field": "simulation_id",
"description": "Simulation '4bgnvEcWRtj5HbtfEujWdT' is currently active with status 'IN PROGRESS' and cannot be rerun"
}
]
}
}{
"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."
}
]
}
}Rerun a simulation
Requeue a single existing simulation to run again in place. The currently visible result for this simulation will be overwritten when the rerun completes.
curl --request POST \
--url https://api.coval.dev/v1/simulations/{simulation_id}/resimulate \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '{}'import requests
url = "https://api.coval.dev/v1/simulations/{simulation_id}/resimulate"
payload = {}
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({})
};
fetch('https://api.coval.dev/v1/simulations/{simulation_id}/resimulate', 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/{simulation_id}/resimulate",
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([
]),
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/{simulation_id}/resimulate"
payload := strings.NewReader("{}")
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/{simulation_id}/resimulate")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coval.dev/v1/simulations/{simulation_id}/resimulate")
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 = "{}"
response = http.request(request)
puts response.read_body{
"simulation_id": "4bgnvEcWRtj5HbtfEujWdT",
"run_id": "3zfmuDbVQsi4GaseDtiVcS",
"queued": true,
"message": "Simulation rerun queued. The latest database-backed versions of the agent, persona, test set, test case, metrics, and mutation config will be reloaded before execution, and the current simulation result will be overwritten."
}{
"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": "FAILED_PRECONDITION",
"message": "Simulation cannot be rerun",
"details": [
{
"field": "simulation_id",
"description": "Simulation '4bgnvEcWRtj5HbtfEujWdT' is currently active with status 'IN PROGRESS' and cannot be rerun"
}
]
}
}{
"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.
Path Parameters
The simulation ID to rerun
22 - 27Body
Request body for resimulating a simulation. Currently no user-facing fields; the body may be empty or omitted.
Response
Simulation rerun was accepted and queued
The simulation that was queued for rerun
"4bgnvEcWRtj5HbtfEujWdT"
The parent run that owns the simulation
"3zfmuDbVQsi4GaseDtiVcS"
Whether the resimulation job was queued successfully
true
Human-readable summary of rerun behavior
"Simulation rerun queued. The latest database-backed versions of the agent, persona, test set, test case, metrics, and mutation config will be reloaded before execution, and the current simulation result will be overwritten."
Was this page helpful?