Skip to main content
POST
/
v1
/
simulation
/
plan
/
{planId}
/
job
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 response = await client.simulationRunPlanJob.start('7f3e4d2c-8a91-4b5c-9e6f-1a2b3c4d5e6f');

console.log(response.data);
{
  "data": {
    "simulationRunPlanId": "9a8b7c6d-5e4f-3210-abcd-ef9876543210",
    "simulationRunPlanJobId": "7f3e4d2c-8a91-4b5c-9e6f-1a2b3c4d5e6f",
    "status": "PENDING",
    "createdAt": "2024-01-15T10:30:00Z"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

Body

application/json

Optional request body for running a simulation plan with runtime variables

variables
object

Runtime variables that override plan-defined scenario variables. Accepts one of two formats:

Option 1 — Global (flat key-value object, applies to ALL scenarios): { "orderNumber": "12345", "environment": "staging" }

Option 2 — Per-scenario (array of objects with scenarioId + variables): [ { "scenarioId": "550e8400-...", "variables": { "orderNumber": "12345" } }, { "scenarioId": "7a3d2e1f-...", "variables": { "orderNumber": "67890" } } ]

Example:
{
"orderNumber": "12345",
"environment": "staging"
}

Response

Successfully triggered simulation run plan

data
object
required

Response when triggering a simulation run plan

Example:
{
"simulationRunPlanId": "9a8b7c6d-5e4f-3210-abcd-ef9876543210",
"simulationRunPlanJobId": "7f3e4d2c-8a91-4b5c-9e6f-1a2b3c4d5e6f",
"status": "PENDING",
"createdAt": "2024-01-15T10:30:00Z"
}