ScenarioExecutor class
Bases: Resource
Execute a scenario
post: tags: - api description: | Executes a scenario by scenario_id. If the scenario does not exist, a 404 error is returned.
!!! Example
=== "Curl"
```shell
curl -X POST http://localhost:5000/api/v1/scenarios/submit/SCENARIO_658d-5834-4d73-84e4-a6343df5e08c
```
In this example the REST API is served on port 5000 on localhost. We are using curl command line
client.
`SCENARIO_63cb358d-5834-4d73-84e4-a6343df5e08c` is the value of the *scenario_id* parameter. It
represents the identifier of the Scenario we want to submit.
Here is the output message example:
```
{"message": "Executed scenario SCENARIO_63cb358d-5834-4d73-84e4-a6343df5e08c."}
```
=== "Python"
This Python example requires the 'requests' package to be installed (`pip install requests`).
```python
import requests
response = requests.post(
"http://localhost:5000/api/v1/scenarios/submit/SCENARIO_63cb358d-5834-4d73-84e4-a6343df5e08c"
)
print(response)
print(response.json())
```
`SCENARIO_63cb358d-5834-4d73-84e4-a6343df5e08c` is the value of the *scenario_id* parameter. It
represents the identifier of the Scenario we want to submit.
Here is the output example:
```
<Response [202]>
{"message": "Executed scenario SCENARIO_63cb358d-5834-4d73-84e4-a6343df5e08c."}
```
!!! Note
When the authorization feature is activated (available in Taipy Enterprise edition only), this endpoint
requires the `TAIPY_EXECUTOR` role.
parameters: - in: path name: scenario_id schema: type: string description: The identifier of the scenario to submit. responses: 202: content: application/json: schema: type: object properties: message: type: string description: Status message. scenario: ScenarioSchema 404: description: No scenario has the scenario_id identifier.