Run a benchmark
curl --request POST \
--url https://{command_center_host}/api/v1/benchmarks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"org_id": "<string>",
"scenario_ids": [
"<string>"
],
"with_agent": true,
"gateway": "runner",
"main_engine": "<string>",
"secondary_engine": "<string>",
"gateway_engine": "<string>",
"sequential": false
}
'import requests
url = "https://{command_center_host}/api/v1/benchmarks"
payload = {
"org_id": "<string>",
"scenario_ids": ["<string>"],
"with_agent": True,
"gateway": "runner",
"main_engine": "<string>",
"secondary_engine": "<string>",
"gateway_engine": "<string>",
"sequential": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
org_id: '<string>',
scenario_ids: ['<string>'],
with_agent: true,
gateway: 'runner',
main_engine: '<string>',
secondary_engine: '<string>',
gateway_engine: '<string>',
sequential: false
})
};
fetch('https://{command_center_host}/api/v1/benchmarks', 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://{command_center_host}/api/v1/benchmarks",
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([
'org_id' => '<string>',
'scenario_ids' => [
'<string>'
],
'with_agent' => true,
'gateway' => 'runner',
'main_engine' => '<string>',
'secondary_engine' => '<string>',
'gateway_engine' => '<string>',
'sequential' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://{command_center_host}/api/v1/benchmarks"
payload := strings.NewReader("{\n \"org_id\": \"<string>\",\n \"scenario_ids\": [\n \"<string>\"\n ],\n \"with_agent\": true,\n \"gateway\": \"runner\",\n \"main_engine\": \"<string>\",\n \"secondary_engine\": \"<string>\",\n \"gateway_engine\": \"<string>\",\n \"sequential\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://{command_center_host}/api/v1/benchmarks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"org_id\": \"<string>\",\n \"scenario_ids\": [\n \"<string>\"\n ],\n \"with_agent\": true,\n \"gateway\": \"runner\",\n \"main_engine\": \"<string>\",\n \"secondary_engine\": \"<string>\",\n \"gateway_engine\": \"<string>\",\n \"sequential\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{command_center_host}/api/v1/benchmarks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"org_id\": \"<string>\",\n \"scenario_ids\": [\n \"<string>\"\n ],\n \"with_agent\": true,\n \"gateway\": \"runner\",\n \"main_engine\": \"<string>\",\n \"secondary_engine\": \"<string>\",\n \"gateway_engine\": \"<string>\",\n \"sequential\": false\n}"
response = http.request(request)
puts response.read_body{
"benchmark_id": "bch_0f4a6d1b-...",
"workflow_id": "wfl_7d3b9c2e-...",
"report_ids": [
"<string>"
]
}{
"code": "VALIDATION_FAILED",
"message": "Validation failed",
"request_id": "req_3702b7e7-...",
"field": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>"
}
],
"details": {}
}{
"code": "VALIDATION_FAILED",
"message": "Validation failed",
"request_id": "req_3702b7e7-...",
"field": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>"
}
],
"details": {}
}{
"code": "VALIDATION_FAILED",
"message": "Validation failed",
"request_id": "req_3702b7e7-...",
"field": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>"
}
],
"details": {}
}{
"code": "VALIDATION_FAILED",
"message": "Validation failed",
"request_id": "req_3702b7e7-...",
"field": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>"
}
],
"details": {}
}Benchmarks
Run a benchmark
One benchmark over the scenarios given, each as its own run. Accepted, not finished. Scheduling is not supported: call this for each occurrence.
POST
/
api
/
v1
/
benchmarks
Run a benchmark
curl --request POST \
--url https://{command_center_host}/api/v1/benchmarks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"org_id": "<string>",
"scenario_ids": [
"<string>"
],
"with_agent": true,
"gateway": "runner",
"main_engine": "<string>",
"secondary_engine": "<string>",
"gateway_engine": "<string>",
"sequential": false
}
'import requests
url = "https://{command_center_host}/api/v1/benchmarks"
payload = {
"org_id": "<string>",
"scenario_ids": ["<string>"],
"with_agent": True,
"gateway": "runner",
"main_engine": "<string>",
"secondary_engine": "<string>",
"gateway_engine": "<string>",
"sequential": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
org_id: '<string>',
scenario_ids: ['<string>'],
with_agent: true,
gateway: 'runner',
main_engine: '<string>',
secondary_engine: '<string>',
gateway_engine: '<string>',
sequential: false
})
};
fetch('https://{command_center_host}/api/v1/benchmarks', 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://{command_center_host}/api/v1/benchmarks",
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([
'org_id' => '<string>',
'scenario_ids' => [
'<string>'
],
'with_agent' => true,
'gateway' => 'runner',
'main_engine' => '<string>',
'secondary_engine' => '<string>',
'gateway_engine' => '<string>',
'sequential' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://{command_center_host}/api/v1/benchmarks"
payload := strings.NewReader("{\n \"org_id\": \"<string>\",\n \"scenario_ids\": [\n \"<string>\"\n ],\n \"with_agent\": true,\n \"gateway\": \"runner\",\n \"main_engine\": \"<string>\",\n \"secondary_engine\": \"<string>\",\n \"gateway_engine\": \"<string>\",\n \"sequential\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://{command_center_host}/api/v1/benchmarks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"org_id\": \"<string>\",\n \"scenario_ids\": [\n \"<string>\"\n ],\n \"with_agent\": true,\n \"gateway\": \"runner\",\n \"main_engine\": \"<string>\",\n \"secondary_engine\": \"<string>\",\n \"gateway_engine\": \"<string>\",\n \"sequential\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{command_center_host}/api/v1/benchmarks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"org_id\": \"<string>\",\n \"scenario_ids\": [\n \"<string>\"\n ],\n \"with_agent\": true,\n \"gateway\": \"runner\",\n \"main_engine\": \"<string>\",\n \"secondary_engine\": \"<string>\",\n \"gateway_engine\": \"<string>\",\n \"sequential\": false\n}"
response = http.request(request)
puts response.read_body{
"benchmark_id": "bch_0f4a6d1b-...",
"workflow_id": "wfl_7d3b9c2e-...",
"report_ids": [
"<string>"
]
}{
"code": "VALIDATION_FAILED",
"message": "Validation failed",
"request_id": "req_3702b7e7-...",
"field": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>"
}
],
"details": {}
}{
"code": "VALIDATION_FAILED",
"message": "Validation failed",
"request_id": "req_3702b7e7-...",
"field": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>"
}
],
"details": {}
}{
"code": "VALIDATION_FAILED",
"message": "Validation failed",
"request_id": "req_3702b7e7-...",
"field": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>"
}
],
"details": {}
}{
"code": "VALIDATION_FAILED",
"message": "Validation failed",
"request_id": "req_3702b7e7-...",
"field": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>"
}
],
"details": {}
}Authorizations
An API key minted in Command Center (Settings -> API Keys), sent as Authorization: Bearer 2501_ak_.... A Command Center session cookie is also accepted.
Body
application/json
Required array length:
1 - 50 elementsAvailable options:
runner, servicenow Minimum string length:
1Minimum string length:
1Minimum string length:
1
