curl --request POST \
--url https://api.coval.dev/v1/metrics/{metric_id}/test \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"simulation_output_id": "<string>",
"simulation_output_ids": [
"<string>"
],
"dev_id": "<string>"
}
'import requests
url = "https://api.coval.dev/v1/metrics/{metric_id}/test"
payload = {
"simulation_output_id": "<string>",
"simulation_output_ids": ["<string>"],
"dev_id": "<string>"
}
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_output_id: '<string>',
simulation_output_ids: ['<string>'],
dev_id: '<string>'
})
};
fetch('https://api.coval.dev/v1/metrics/{metric_id}/test', 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/metrics/{metric_id}/test",
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_output_id' => '<string>',
'simulation_output_ids' => [
'<string>'
],
'dev_id' => '<string>'
]),
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/metrics/{metric_id}/test"
payload := strings.NewReader("{\n \"simulation_output_id\": \"<string>\",\n \"simulation_output_ids\": [\n \"<string>\"\n ],\n \"dev_id\": \"<string>\"\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/metrics/{metric_id}/test")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"simulation_output_id\": \"<string>\",\n \"simulation_output_ids\": [\n \"<string>\"\n ],\n \"dev_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coval.dev/v1/metrics/{metric_id}/test")
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_output_id\": \"<string>\",\n \"simulation_output_ids\": [\n \"<string>\"\n ],\n \"dev_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"simulation_output_id": "<string>",
"status": "QUEUED",
"metric_output_ulid": "<string>",
"error": "<string>"
}
],
"metric_output_ulid": "<string>"
}{
"results": [
{
"simulation_output_id": "<string>",
"status": "QUEUED",
"metric_output_ulid": "<string>",
"error": "<string>"
}
],
"metric_output_ulid": "<string>"
}{
"error": {
"code": "INVALID_ARGUMENT",
"message": "<string>",
"details": [
{
"field": "<string>",
"description": "<string>"
}
]
}
}{
"error": {
"code": "INVALID_ARGUMENT",
"message": "<string>",
"details": [
{
"field": "<string>",
"description": "<string>"
}
]
}
}{
"error": {
"code": "INVALID_ARGUMENT",
"message": "<string>",
"details": [
{
"field": "<string>",
"description": "<string>"
}
]
}
}{
"error": {
"code": "INVALID_ARGUMENT",
"message": "<string>",
"details": [
{
"field": "<string>",
"description": "<string>"
}
]
}
}{
"error": {
"code": "INVALID_ARGUMENT",
"message": "<string>",
"details": [
{
"field": "<string>",
"description": "<string>"
}
]
}
}{
"error": {
"code": "INVALID_ARGUMENT",
"message": "<string>",
"details": [
{
"field": "<string>",
"description": "<string>"
}
]
}
}Trigger test metric execution
Trigger execution of a metric against one or more simulation outputs for testing purposes. This is an asynchronous operation that returns immediately.
Provide exactly one of simulation_output_id (single, deprecated) or
simulation_output_ids (batch, up to 100 IDs per call). Batch requests
are best-effort: individual simulation outputs that cannot be queued are
reported in results with a non-QUEUED status instead of failing the
whole call.
The response contains one entry per requested simulation output in
results, each with its own status and, when queued, a
metric_output_ulid.
Retrieving results: for each queued entry, poll
GET /v1/conversations/simulated/{simulation_id}/metrics/{metric_output_id} using the
entry’s simulation_output_id as simulation_id and its 26-char
metric_output_ulid as metric_output_id. The response includes a
status field (IN QUEUE, IN PROGRESS, COMPLETED, FAILED) — poll
until it is terminal. Test results belong to the simulation they ran
against, so they are not available on the conversations endpoint.
curl --request POST \
--url https://api.coval.dev/v1/metrics/{metric_id}/test \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"simulation_output_id": "<string>",
"simulation_output_ids": [
"<string>"
],
"dev_id": "<string>"
}
'import requests
url = "https://api.coval.dev/v1/metrics/{metric_id}/test"
payload = {
"simulation_output_id": "<string>",
"simulation_output_ids": ["<string>"],
"dev_id": "<string>"
}
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_output_id: '<string>',
simulation_output_ids: ['<string>'],
dev_id: '<string>'
})
};
fetch('https://api.coval.dev/v1/metrics/{metric_id}/test', 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/metrics/{metric_id}/test",
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_output_id' => '<string>',
'simulation_output_ids' => [
'<string>'
],
'dev_id' => '<string>'
]),
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/metrics/{metric_id}/test"
payload := strings.NewReader("{\n \"simulation_output_id\": \"<string>\",\n \"simulation_output_ids\": [\n \"<string>\"\n ],\n \"dev_id\": \"<string>\"\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/metrics/{metric_id}/test")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"simulation_output_id\": \"<string>\",\n \"simulation_output_ids\": [\n \"<string>\"\n ],\n \"dev_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coval.dev/v1/metrics/{metric_id}/test")
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_output_id\": \"<string>\",\n \"simulation_output_ids\": [\n \"<string>\"\n ],\n \"dev_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"simulation_output_id": "<string>",
"status": "QUEUED",
"metric_output_ulid": "<string>",
"error": "<string>"
}
],
"metric_output_ulid": "<string>"
}{
"results": [
{
"simulation_output_id": "<string>",
"status": "QUEUED",
"metric_output_ulid": "<string>",
"error": "<string>"
}
],
"metric_output_ulid": "<string>"
}{
"error": {
"code": "INVALID_ARGUMENT",
"message": "<string>",
"details": [
{
"field": "<string>",
"description": "<string>"
}
]
}
}{
"error": {
"code": "INVALID_ARGUMENT",
"message": "<string>",
"details": [
{
"field": "<string>",
"description": "<string>"
}
]
}
}{
"error": {
"code": "INVALID_ARGUMENT",
"message": "<string>",
"details": [
{
"field": "<string>",
"description": "<string>"
}
]
}
}{
"error": {
"code": "INVALID_ARGUMENT",
"message": "<string>",
"details": [
{
"field": "<string>",
"description": "<string>"
}
]
}
}{
"error": {
"code": "INVALID_ARGUMENT",
"message": "<string>",
"details": [
{
"field": "<string>",
"description": "<string>"
}
]
}
}{
"error": {
"code": "INVALID_ARGUMENT",
"message": "<string>",
"details": [
{
"field": "<string>",
"description": "<string>"
}
]
}
}Authorizations
API key for authentication
Path Parameters
The metric ID (22-character ShortUUID)
^[a-zA-Z0-9]{22}$Body
Provide exactly one of simulation_output_id or simulation_output_ids.
Deprecated: a single simulation output ID (22-character ShortUUID) to run the metric against. Prefer simulation_output_ids.
^[a-zA-Z0-9]{22}$Simulation output IDs (22-character ShortUUIDs) to run the metric against; 1–100 per call.
1 - 100 elements^[a-zA-Z0-9]{22}$Optional developer identifier for debugging
Response
All requested test metric executions queued successfully
One entry per requested simulation output.
Show child attributes
Show child attributes
Deprecated: the ULID of the created metric output, used to track the result. Only set for single simulation_output_id requests; null for batch (simulation_output_ids) requests, which should read results instead.
26^[0-9A-HJKMNP-TV-Z]{26}$Was this page helpful?