import Roark from '@roarkanalytics/sdk';
const client = new Roark({
bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted
});
const simulationRunGroup = await client.simulationRunGroup.create();
console.log(simulationRunGroup.data);import os
from roark_analytics import Roark
client = Roark(
bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted
)
simulation_run_group = client.simulation_run_group.create()
print(simulation_run_group.data)curl --request POST \
--url https://api.roark.ai/v1/simulation/run-group \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Release 4.2 regression",
"simulationRunPlanIds": [
"3c1d2e4f-5a6b-4c7d-8e9f-0a1b2c3d4e5f",
"6d7e8f9a-0b1c-4d2e-9f3a-4b5c6d7e8f9a"
]
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.roark.ai/v1/simulation/run-group",
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([
'name' => 'Release 4.2 regression',
'simulationRunPlanIds' => [
'3c1d2e4f-5a6b-4c7d-8e9f-0a1b2c3d4e5f',
'6d7e8f9a-0b1c-4d2e-9f3a-4b5c6d7e8f9a'
]
]),
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://api.roark.ai/v1/simulation/run-group"
payload := strings.NewReader("{\n \"name\": \"Release 4.2 regression\",\n \"simulationRunPlanIds\": [\n \"3c1d2e4f-5a6b-4c7d-8e9f-0a1b2c3d4e5f\",\n \"6d7e8f9a-0b1c-4d2e-9f3a-4b5c6d7e8f9a\"\n ]\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://api.roark.ai/v1/simulation/run-group")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Release 4.2 regression\",\n \"simulationRunPlanIds\": [\n \"3c1d2e4f-5a6b-4c7d-8e9f-0a1b2c3d4e5f\",\n \"6d7e8f9a-0b1c-4d2e-9f3a-4b5c6d7e8f9a\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.roark.ai/v1/simulation/run-group")
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 \"name\": \"Release 4.2 regression\",\n \"simulationRunPlanIds\": [\n \"3c1d2e4f-5a6b-4c7d-8e9f-0a1b2c3d4e5f\",\n \"6d7e8f9a-0b1c-4d2e-9f3a-4b5c6d7e8f9a\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"createdAt": "<string>",
"runCount": 123,
"runs": [
{
"simulationRunPlanJobId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"simulationRunPlanId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"planName": "<string>",
"runNumber": 123,
"status": "PENDING",
"createdAt": "<string>",
"startedAt": "<string>",
"endedAt": "<string>"
}
],
"latestReport": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "PENDING",
"errorMessage": "<string>",
"createdAt": "<string>",
"completedAt": "<string>",
"document": {
"version": 1,
"generatedAtIso": "<string>",
"model": "<string>",
"simulationRunGroupId": "<string>",
"headline": {
"groupName": "<string>",
"runCount": 123,
"reportedRunCount": 123,
"passedRunCount": 123,
"callCount": 123,
"verdict": "PASSED",
"completedAtIso": "<string>",
"verdictProse": "<string>",
"statTiles": [
{
"label": "<string>",
"value": "<string>",
"sub": "<string>",
"deltaDirection": "POSITIVE"
}
]
},
"runs": [
{
"simulationRunPlanJobId": "<string>",
"runLabel": "<string>",
"runNumber": 123,
"status": "PENDING",
"verdict": "PASSED",
"callCount": 123,
"checksPassed": 123,
"checksTotal": 123,
"themeCount": 123,
"completedAtIso": "<string>",
"summary": "<string>"
}
],
"executiveSummary": [
{
"heading": "<string>",
"body": "<string>"
}
],
"scorecard": [
{
"checkName": "<string>",
"runCount": 123,
"failedRunCount": 123,
"failedCount": 123,
"evaluatedCount": 123,
"passRatePct": 123
}
],
"wentWell": [
{
"title": "<string>",
"body": "<string>",
"evidence": [
{
"text": "<string>",
"simulationRunPlanJobId": "<string>",
"conversationId": "<string>",
"callId": "<string>",
"personaName": "<string>",
"cueMs": 123
}
]
}
],
"issues": [
{
"order": 123,
"title": "<string>",
"body": "<string>",
"severity": "HIGH",
"rootCauseChannel": "PROMPT",
"affectedCallCount": 123,
"runLabels": [
"<string>"
],
"checkNames": [
"<string>"
],
"sourceThemes": [
{
"simulationRunPlanJobId": "<string>",
"slug": "<string>"
}
],
"evidence": [
{
"text": "<string>",
"simulationRunPlanJobId": "<string>",
"conversationId": "<string>",
"callId": "<string>",
"personaName": "<string>",
"cueMs": 123
}
],
"calls": [
{
"simulationRunPlanJobId": "<string>",
"conversationId": "<string>",
"callId": "<string>",
"personaName": "<string>",
"cueMs": 123
}
]
}
],
"smallerItems": [
{
"order": 123,
"title": "<string>",
"body": "<string>",
"severity": "HIGH",
"rootCauseChannel": "PROMPT",
"affectedCallCount": 123,
"runLabels": [
"<string>"
],
"checkNames": [
"<string>"
],
"sourceThemes": [
{
"simulationRunPlanJobId": "<string>",
"slug": "<string>"
}
],
"evidence": [
{
"text": "<string>",
"simulationRunPlanJobId": "<string>",
"conversationId": "<string>",
"callId": "<string>",
"personaName": "<string>",
"cueMs": 123
}
],
"calls": [
{
"simulationRunPlanJobId": "<string>",
"conversationId": "<string>",
"callId": "<string>",
"personaName": "<string>",
"cueMs": 123
}
]
}
],
"recommendations": [
{
"order": 123,
"title": "<string>",
"body": "<string>",
"channel": "PROMPT",
"issueOrders": [
123
]
}
],
"aggregates": [
{
"metricName": "<string>",
"averageLabel": "<string>",
"medianLabel": "<string>",
"p95Label": "<string>",
"evaluatedCount": 123
}
],
"methodology": "<string>"
}
}
}
}{
"type": "validation",
"code": "invalid_parameter",
"message": "The request was invalid",
"param": "email"
}{
"type": "authentication",
"code": "unauthorized",
"message": "Authentication required"
}{
"type": "payment_required",
"code": "insufficient_credits",
"message": "Not enough credit to start this work. Add credit and try again."
}{
"type": "forbidden",
"code": "permission_denied",
"message": "You do not have permission to access this resource"
}{
"type": "not_found",
"code": "resource_not_found",
"message": "The requested resource could not be found"
}{
"type": "rate_limit",
"code": "too_many_requests",
"message": "Rate limit exceeded"
}{
"type": "internal",
"code": "internal_error",
"message": "Internal server error"
}Create a run group
Groups several simulation runs so they read as one, and starts generating the group report: one document across every run, with a scorecard summed across them and the issues found, each merged from the per-run debriefs.
Send simulationRunPlanJobIds to group runs that already exist (runs still in progress are
fine: the report waits for them). Send simulationRunPlanIds to start one run of each plan
and group those; this places real calls, exactly as starting each plan would.
Poll GET /v1/simulation/run-group/ until latestReport.status is READY.
import Roark from '@roarkanalytics/sdk';
const client = new Roark({
bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted
});
const simulationRunGroup = await client.simulationRunGroup.create();
console.log(simulationRunGroup.data);import os
from roark_analytics import Roark
client = Roark(
bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted
)
simulation_run_group = client.simulation_run_group.create()
print(simulation_run_group.data)curl --request POST \
--url https://api.roark.ai/v1/simulation/run-group \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Release 4.2 regression",
"simulationRunPlanIds": [
"3c1d2e4f-5a6b-4c7d-8e9f-0a1b2c3d4e5f",
"6d7e8f9a-0b1c-4d2e-9f3a-4b5c6d7e8f9a"
]
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.roark.ai/v1/simulation/run-group",
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([
'name' => 'Release 4.2 regression',
'simulationRunPlanIds' => [
'3c1d2e4f-5a6b-4c7d-8e9f-0a1b2c3d4e5f',
'6d7e8f9a-0b1c-4d2e-9f3a-4b5c6d7e8f9a'
]
]),
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://api.roark.ai/v1/simulation/run-group"
payload := strings.NewReader("{\n \"name\": \"Release 4.2 regression\",\n \"simulationRunPlanIds\": [\n \"3c1d2e4f-5a6b-4c7d-8e9f-0a1b2c3d4e5f\",\n \"6d7e8f9a-0b1c-4d2e-9f3a-4b5c6d7e8f9a\"\n ]\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://api.roark.ai/v1/simulation/run-group")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Release 4.2 regression\",\n \"simulationRunPlanIds\": [\n \"3c1d2e4f-5a6b-4c7d-8e9f-0a1b2c3d4e5f\",\n \"6d7e8f9a-0b1c-4d2e-9f3a-4b5c6d7e8f9a\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.roark.ai/v1/simulation/run-group")
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 \"name\": \"Release 4.2 regression\",\n \"simulationRunPlanIds\": [\n \"3c1d2e4f-5a6b-4c7d-8e9f-0a1b2c3d4e5f\",\n \"6d7e8f9a-0b1c-4d2e-9f3a-4b5c6d7e8f9a\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"createdAt": "<string>",
"runCount": 123,
"runs": [
{
"simulationRunPlanJobId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"simulationRunPlanId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"planName": "<string>",
"runNumber": 123,
"status": "PENDING",
"createdAt": "<string>",
"startedAt": "<string>",
"endedAt": "<string>"
}
],
"latestReport": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "PENDING",
"errorMessage": "<string>",
"createdAt": "<string>",
"completedAt": "<string>",
"document": {
"version": 1,
"generatedAtIso": "<string>",
"model": "<string>",
"simulationRunGroupId": "<string>",
"headline": {
"groupName": "<string>",
"runCount": 123,
"reportedRunCount": 123,
"passedRunCount": 123,
"callCount": 123,
"verdict": "PASSED",
"completedAtIso": "<string>",
"verdictProse": "<string>",
"statTiles": [
{
"label": "<string>",
"value": "<string>",
"sub": "<string>",
"deltaDirection": "POSITIVE"
}
]
},
"runs": [
{
"simulationRunPlanJobId": "<string>",
"runLabel": "<string>",
"runNumber": 123,
"status": "PENDING",
"verdict": "PASSED",
"callCount": 123,
"checksPassed": 123,
"checksTotal": 123,
"themeCount": 123,
"completedAtIso": "<string>",
"summary": "<string>"
}
],
"executiveSummary": [
{
"heading": "<string>",
"body": "<string>"
}
],
"scorecard": [
{
"checkName": "<string>",
"runCount": 123,
"failedRunCount": 123,
"failedCount": 123,
"evaluatedCount": 123,
"passRatePct": 123
}
],
"wentWell": [
{
"title": "<string>",
"body": "<string>",
"evidence": [
{
"text": "<string>",
"simulationRunPlanJobId": "<string>",
"conversationId": "<string>",
"callId": "<string>",
"personaName": "<string>",
"cueMs": 123
}
]
}
],
"issues": [
{
"order": 123,
"title": "<string>",
"body": "<string>",
"severity": "HIGH",
"rootCauseChannel": "PROMPT",
"affectedCallCount": 123,
"runLabels": [
"<string>"
],
"checkNames": [
"<string>"
],
"sourceThemes": [
{
"simulationRunPlanJobId": "<string>",
"slug": "<string>"
}
],
"evidence": [
{
"text": "<string>",
"simulationRunPlanJobId": "<string>",
"conversationId": "<string>",
"callId": "<string>",
"personaName": "<string>",
"cueMs": 123
}
],
"calls": [
{
"simulationRunPlanJobId": "<string>",
"conversationId": "<string>",
"callId": "<string>",
"personaName": "<string>",
"cueMs": 123
}
]
}
],
"smallerItems": [
{
"order": 123,
"title": "<string>",
"body": "<string>",
"severity": "HIGH",
"rootCauseChannel": "PROMPT",
"affectedCallCount": 123,
"runLabels": [
"<string>"
],
"checkNames": [
"<string>"
],
"sourceThemes": [
{
"simulationRunPlanJobId": "<string>",
"slug": "<string>"
}
],
"evidence": [
{
"text": "<string>",
"simulationRunPlanJobId": "<string>",
"conversationId": "<string>",
"callId": "<string>",
"personaName": "<string>",
"cueMs": 123
}
],
"calls": [
{
"simulationRunPlanJobId": "<string>",
"conversationId": "<string>",
"callId": "<string>",
"personaName": "<string>",
"cueMs": 123
}
]
}
],
"recommendations": [
{
"order": 123,
"title": "<string>",
"body": "<string>",
"channel": "PROMPT",
"issueOrders": [
123
]
}
],
"aggregates": [
{
"metricName": "<string>",
"averageLabel": "<string>",
"medianLabel": "<string>",
"p95Label": "<string>",
"evaluatedCount": 123
}
],
"methodology": "<string>"
}
}
}
}{
"type": "validation",
"code": "invalid_parameter",
"message": "The request was invalid",
"param": "email"
}{
"type": "authentication",
"code": "unauthorized",
"message": "Authentication required"
}{
"type": "payment_required",
"code": "insufficient_credits",
"message": "Not enough credit to start this work. Add credit and try again."
}{
"type": "forbidden",
"code": "permission_denied",
"message": "You do not have permission to access this resource"
}{
"type": "not_found",
"code": "resource_not_found",
"message": "The requested resource could not be found"
}{
"type": "rate_limit",
"code": "too_many_requests",
"message": "Rate limit exceeded"
}{
"type": "internal",
"code": "internal_error",
"message": "Internal server error"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Group existing runs, or start one run per plan and group those.
What to call the group. Defaults to the plans' names when starting plans, and to the runs' plan names when grouping existing runs.
1 - 200"Release 4.2 regression"
Runs that already exist, in display order (2 to 20). Runs still in progress are fine: the group report waits for them. Send this or simulationRunPlanIds, not both.
2 - 20 elements[ "7f3e4d2c-8a91-4b5c-9e6f-1a2b3c4d5e6f", "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d" ]
Plans to run once each, in display order (2 to 20). Each plan starts a run, exactly as POST /v1/simulation/plan/{planId}/job would. Send this or simulationRunPlanJobIds, not both.
2 - 20 elements[ "7f3e4d2c-8a91-4b5c-9e6f-1a2b3c4d5e6f", "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d" ]
Response
The run group, with its report requested
Several simulation runs read as one.
Show child attributes
Show child attributes