Edit a scenario
Updates the properties of a specific scenario, such as its name, description, associated graph, or the simulator agent's prompt.
Edit a scenario
Updates the properties of a specific scenario, such as its name, description, associated graph, or the simulator agent’s prompt.
https://api.futureagi.com/simulate/scenarios/{scenario_id}/edit/ Click "Try It" to send a request
Authentication
This endpoint requires authentication. Include your API key in the Authorization header:
Authorization: Bearer YOUR_API_KEY
Parameters
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
scenario_id | string | Yes | The UUID of the scenario to edit. |
Request Body
-
name: string The new name for the scenario.
-
description: string The new description for the scenario.
-
graph: object The updated graph structure for the scenario. If the scenario does not have a graph, a new one will be created.
-
prompt: string The new prompt for the simulator agent associated with the scenario. Supports templating variables like
{{persona}}and{{situation}}.
Example
{
"name": "your-name",
"description": "your-description",
"graph": {},
"prompt": "your-prompt"
}
Responses
200
Scenario updated successfully.
- message: string
Example:
Scenario updated successfully - scenario: any
400
Bad Request. The provided data is invalid, for example, an empty name.
401
Unauthorized. Authentication credentials were not provided or are invalid.
404
Not Found. The scenario with the specified ID could not be found.
500
Internal Server Error. An unexpected error occurred while updating the scenario.
Code Examples
cURL
curl -X PUT "https://api.futureagi.com/simulate/scenarios/{scenario_id}/edit/" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "your-name", "description": "your-description", "graph": {}, "prompt": "your-prompt"}'
Python
import requests
url = "https://api.futureagi.com/simulate/scenarios/{scenario_id}/edit/"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
data = {
"name": "your-name",
"description": "your-description",
"graph": {},
"prompt": "your-prompt"
}
response = requests.put(url, headers=headers, json=data)
print(response.json())
JavaScript
const response = await fetch("https://api.futureagi.com/simulate/scenarios/{scenario_id}/edit/", {
method: "PUT",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
"name": "your-name",
"description": "your-description",
"graph": {},
"prompt": "your-prompt"
})
});
const data = await response.json();
console.log(data);