JavaScript
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 simulationTemplates = await client.simulationTemplate.list();
console.log(simulationTemplates.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_templates = client.simulation_template.list()
print(simulation_templates.data)curl --request GET \
--url https://api.roark.ai/v1/simulation/template \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.roark.ai/v1/simulation/template",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.roark.ai/v1/simulation/template"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.roark.ai/v1/simulation/template")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.roark.ai/v1/simulation/template")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"slug": "red-teaming",
"title": "Red teaming",
"description": "Adversarial probing. Tests refusals, jailbreak resistance, and whether the agent’s policy holds.",
"category": "Safety",
"metrics": [
{
"id": "9c1e2f3a-4b5c-4d6e-8f70-1a2b3c4d5e6f",
"slug": "compliance_prompt_injection_resistance"
}
],
"thresholds": [
{
"id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
"slug": "compliance_prompt_injection_resistance_check"
}
],
"flows": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"title": "Prompt injection",
"slug": "sf-prompt-injection",
"happyPath": {
"title": "Direct attempt"
},
"edgeCases": [
{
"id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"title": "Encoded payload",
"slug": "data-embedded-injection"
}
]
}
],
"includeFlowMetrics": false,
"defaultMaxSimulationDurationSeconds": 900
}
]
}{
"type": "authentication",
"code": "unauthorized",
"message": "Authentication required"
}{
"type": "forbidden",
"code": "permission_denied",
"message": "You do not have permission to access this resource"
}{
"type": "rate_limit",
"code": "too_many_requests",
"message": "Rate limit exceeded"
}{
"type": "internal",
"code": "internal_error",
"message": "Internal server error"
}Simulation Template
List simulation templates
Returns the built-in simulation templates, each resolved against this project: the metric and check definitions it collects, and the flows it runs with the variants it covers.
A template is a preset rather than a stored object, so building a run from one produces an
ordinary run plan you own and can edit afterwards. Pass a slug as template to
POST /v1/simulation/run.
Every entry is complete, so there is no per-template endpoint to follow up with, and the list is a fixed catalogue rather than a paginated one. Only templates a request can actually run are listed.
GET
/
v1
/
simulation
/
template
JavaScript
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 simulationTemplates = await client.simulationTemplate.list();
console.log(simulationTemplates.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_templates = client.simulation_template.list()
print(simulation_templates.data)curl --request GET \
--url https://api.roark.ai/v1/simulation/template \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.roark.ai/v1/simulation/template",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.roark.ai/v1/simulation/template"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.roark.ai/v1/simulation/template")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.roark.ai/v1/simulation/template")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"slug": "red-teaming",
"title": "Red teaming",
"description": "Adversarial probing. Tests refusals, jailbreak resistance, and whether the agent’s policy holds.",
"category": "Safety",
"metrics": [
{
"id": "9c1e2f3a-4b5c-4d6e-8f70-1a2b3c4d5e6f",
"slug": "compliance_prompt_injection_resistance"
}
],
"thresholds": [
{
"id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
"slug": "compliance_prompt_injection_resistance_check"
}
],
"flows": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"title": "Prompt injection",
"slug": "sf-prompt-injection",
"happyPath": {
"title": "Direct attempt"
},
"edgeCases": [
{
"id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"title": "Encoded payload",
"slug": "data-embedded-injection"
}
]
}
],
"includeFlowMetrics": false,
"defaultMaxSimulationDurationSeconds": 900
}
]
}{
"type": "authentication",
"code": "unauthorized",
"message": "Authentication required"
}{
"type": "forbidden",
"code": "permission_denied",
"message": "You do not have permission to access this resource"
}{
"type": "rate_limit",
"code": "too_many_requests",
"message": "Rate limit exceeded"
}{
"type": "internal",
"code": "internal_error",
"message": "Internal server error"
}