Simulation

Run a simulation

Changed on

Starts a simulation and returns the run.

Send template to run one of the built-in templates: it supplies the metrics and checks, and for some templates the flows too, so the request only names the agent and the direction. Send plan to describe a simulation yourself and run it once. Send planId to run a plan you already have.

template and plan both resolve to a run plan, returned as simulationRunPlanId. Add saveAsPlan to keep it, or read it back to see exactly what ran. A plan built from a template is a snapshot: retuning the template later never changes what that plan runs, which is what makes a saved one safe to pin in CI.

post/v1/simulation/run

Request

  • Base URL
    https://api.roark.ai
  • URL
    https://api.roark.ai/v1/simulation/run
  • Auth
    HTTP bearer

Request body

OR
OR
OR

Example request

{
  "saveAsPlan": true,
  "plan": {
    "name": "Billing regression",
    "direction": "OUTBOUND",
    "maxSimulationDurationSeconds": 300,
    "agentEndpoints": [
      {
        "id": "7c9e6679-7425-40de-944b-e07fc1f90ae7"
      }
    ],
    "metrics": [
      {
        "slug": "customer_satisfaction"
      }
    ],
    "flows": [
      {
        "id": "550e8400-e29b-41d4-a716-446655440000",
        "happyPath": true,
        "edgeCases": "ALL"
      }
    ]
  },
  "variables": {
    "orderNumber": "12345"
  }
}

Response

The run that was started

Changes

    • info

      added to the request body oneOf list

    • breaking

      the /// request property type changed from string to no type

    • breaking

      the // request property type changed from string to no type

    • info

      added the new optional request property /

    • info

      added subschema #1 to the /// request property anyOf list

    • info

      added subschema #1 to the // request property anyOf list