Skip to main content
POST
/
scenario
apply a scenario to the main world
curl --request POST \
  --url http://localhost:3917/scenario \
  --header 'Content-Type: application/json' \
  --data '
{
  "entities": [
    {
      "health": 100,
      "position": [
        -3,
        1,
        0
      ],
      "team": 1
    },
    {
      "health": 60,
      "position": [
        3,
        1,
        0
      ],
      "team": 2
    }
  ],
  "name": "demo",
  "rules": [
    {
      "actions": [
        {
          "action": "heal",
          "amount": 20,
          "target": "this"
        }
      ],
      "filter": "any",
      "when": {
        "kind": "health_below",
        "threshold": 50
      }
    }
  ],
  "version": 2
}
'
{
  "assertions": 0,
  "entities_spawned": 2,
  "ok": true,
  "rules": 1,
  "templates": 0
}

Body

application/json

A declarative scenario document (entities, rules, templates, assertions); see the Rules-as-data guide.

The body is of type any.

Response

200 - application/json

Scenario applied; main world replaced.