Sandboxes

Upsert Sandbox Scenario

Beta
POST
https://api.vellum.ai/v1/sandboxes/:id/scenarios
Upserts a new scenario for a sandbox, keying off of the optionally provided scenario id. If an id is provided and has a match, the scenario will be updated. If no id is provided or no match is found, a new scenario will be appended to the end. Note that a full replacement of the scenario is performed, so any fields not provided will be removed or overwritten with default values.

Path parameters

id
string
A UUID string identifying this sandbox.

Request

This endpoint expects an object.
inputs
list of objects
The inputs for the scenario
label
optional string
scenario_id
optional string
The id of the scenario to update. If none is provided, an id will be generated and a new scenario will be appended.

Response

This endpoint return an object.
inputs
list of objects
The inputs for the scenario
id
string
The id of the scenario
label
optional string
POST
/v1/sandboxes/:id/scenarios
curl -X POST https://api.vellum.ai/v1/sandboxes/id/scenarios \
-H "X_API_KEY: <apiKey>" \
-H "Content-Type: application/json" \
-d '{
"inputs": [
{
"key": "var_1",
"type": "TEXT",
"value": "Hello, world!"
},
{
"key": "var_2",
"type": "TEXT",
"value": "Why hello, there!"
},
{
"key": "key"
}
],
"label": "Scenario 1"
}'
Response
{
"inputs": [
{
"key": "key",
"type": "TEXT",
"value": "value",
"chat_history": [
{
"role": "SYSTEM"
}
]
}
],
"id": "id",
"label": "label"
}