Skip to main content
POST
/
v1
/
simulation
/
scenario
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 simulationScenario = await client.simulationScenario.create({
  name: 'x',
  steps: [{ content: 'content', type: 'AGENT_TURN' }],
});

console.log(simulationScenario.data);
{
  "data": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "name": "<string>",
    "description": "<string>",
    "steps": [
      {
        "nodeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "type": "START",
        "content": "<string>",
        "dtmfDigits": "<string>"
      }
    ],
    "createdAt": "<string>",
    "updatedAt": "<string>"
  }
}

Authorizations

Authorization
string
header
required

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

Body

application/json

Input for creating a new scenario

name
string
required

Name of the scenario (used as the START node content)

Minimum string length: 1
steps
CreateScenarioStepInput · object[]
required

Ordered list of steps for the scenario (at least one step is required)

Minimum array length: 1

Response

The created scenario

data
object
required