API

ScenarioRunLesson

Operations

Every route this entity exposes. Each route links to its own reference on this page.

Method Route SDK operation Returns
POST /api/v1/organizations/{organization_id}/verification/projects/{project_id}/runs/{id}/scenario_runs/{scenario_run_id}/lessons create Lesson saved

Examples

One example per SDK, generated from the API model. The argument names are the parameters and fields of this entity, and the values are placeholders. The examples are not compiled or executed.

Golang

Construct client as shown in the Golang setup, then call the operations:

created, err := client.ScenarioRunLesson(nil).Create(map[string]any{"organization_id": "example", "project_id": "example", "run_id": "example", "scenario_run_id": "example", "finding": "example", "workaround": "example"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(created)

Lua

Construct client as shown in the Lua setup, then call the operations:

local created, err = client:ScenarioRunLesson():create({ organization_id = "example", project_id = "example", run_id = "example", scenario_run_id = "example", finding = "example", workaround = "example" })

PHP

Construct client as shown in the PHP setup, then call the operations:

$created = $client->ScenarioRunLesson()->create(["organization_id" => "example", "project_id" => "example", "run_id" => "example", "scenario_run_id" => "example", "finding" => "example", "workaround" => "example"]);

Python

Construct client as shown in the Python setup, then call the operations:

created = client.ScenarioRunLesson().create({ "organization_id": "example", "project_id": "example", "run_id": "example", "scenario_run_id": "example", "finding": "example", "workaround": "example" })

Ruby

Construct client as shown in the Ruby setup, then call the operations:

created = client.ScenarioRunLesson.create({ "organization_id" => "example", "project_id" => "example", "run_id" => "example", "scenario_run_id" => "example", "finding" => "example", "workaround" => "example" })

TypeScript

Construct client as shown in the TypeScript setup, then call the operations:

const created = await client.ScenarioRunLesson().create({ organization_id: "example", project_id: "example", run_id: "example", scenario_run_id: "example", finding: "example", workaround: "example" })

Fields

Field Type Required Description
finding string Yes Finding
title string No Defaults to the Scenario's name.
workaround string Yes Workaround

create

POST /api/v1/organizations/{organization_id}/verification/projects/{project_id}/runs/{id}/scenario_runs/{scenario_run_id}/lessons

Operation ID: post_api_v1_organizations_organization_id_verification_projects_project_id_runs_id_scenario_runs_scenario_run_id_lessons.

Authentication: bearer token (bearerAuth).

Parameters

Parameter In Type Required Description
organization_id path string Yes
project_id path string Yes
id path string Yes
scenario_run_id path string Yes

Request body

application/json

Property Type Required Description
finding string Yes
title string No Defaults to the Scenario's name.
workaround string Yes

Responses

201: Lesson saved

application/json

Property Type Required Description
confidence enum: low, medium, high Yes
created_at string (date-time) Yes
finding string Yes
id string Yes
indexed_at string (date-time) Yes
response string Yes
scope object Yes
scope.environment_id string Yes
scope.environment_name string Yes
scope.project_id string Yes
scope.project_name string Yes
source object Yes
source.attempt_id string Yes
source.creator_user_id string Yes
source.finding_id string No
source.kind enum: scenario_attempt, operator, run, triage Yes
source.observed_at string (date-time) Yes
source.outcome string Yes
source.persona string Yes
source.purpose string No
source.repository_id string Yes
source.repository_name string Yes
source.run_id string No
source.scenario string Yes
source.scenario_run_id string No
source.sweep_id string Yes
source.triage_id string No The finding triage a dream learned this lesson from
source.verification_run_id string No The run whose failed or blocked Scenario an operator taught this note on
tags array of string Yes
title string Yes
workaround string Yes
403: Organization administrator required
404: Run or ScenarioRun not found in this project
422: The ScenarioRun did not fail or get blocked, or the lesson is invalid