post
- api description: | Creates a new scenario from the config_id. If the config does not exist, a 404 error is returned.
!!! Example
=== "Curl"
```shell
curl -X POST http://localhost:5000/api/v1/scenarios?config_id=my_scenario_config
```
In this example the REST API is served on port 5000 on localhost. We are using curl command line
client.
In this example the *config_id* value ("my_scenario_config") is given as parameter directly in the
url. A corresponding `ScenarioConfig^` must exist and must have been configured before.
Here is the output message example:
```
{"msg": "scenario created.",
"scenario": {
"cycle": "CYCLE_863418_fdd1499a-8925-4540-93fd-9dbfb4f0846d",
"id": "SCENARIO_63cb358d-5834-4d73-84e4-a6343df5e08c",
"properties": {},
"tags": [],
"pipelines": [
"PIPELINE_mean_baseline_5af317c9-34df-48b4-8a8a-bf4007e1de99",
"PIPELINE_arima_90aef6b9-8922-4a0c-b625-b2c6f3d19fa4"],
"subscribers": [],
"creation_date": "2022-08-15T19:21:01.871587",
"primary_scenario": true}
}
```
=== "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?config_id=my_scenario_config")
print(response)
print(response.json())
```
In this example the *config_id* value ("my_scenario_config") is given as parameter directly in the
url. A corresponding `ScenarioConfig^` must exist and must have been configured before.
Here is the output example:
```
<Response [201]>
{"msg": "scenario created.",
"scenario": {
"cycle": "CYCLE_863418_fdd1499a-8925-4540-93fd-9dbfb4f0846d",
"id": "SCENARIO_63cb358d-5834-4d73-84e4-a6343df5e08c",
"properties": {},
"tags": [],
"pipelines": [
"PIPELINE_mean_baseline_5af317c9-34df-48b4-8a8a-bf4007e1de99",
"PIPELINE_arima_90aef6b9-8922-4a0c-b625-b2c6f3d19fa4"],
"subscribers": [],
"creation_date": "2022-08-15T19:21:01.871587",
"primary_scenario": true}
}
```
!!! Note
When the authorization feature is activated (available in Taipy Enterprise edition only), this endpoint
requires the TAIPY_EDITOR
role.
parameters: - in: query name: config_id schema: type: string description: The identifier of the scenario configuration. responses: 201: content: application/json: schema: type: object properties: message: type: string description: Status message. scenario: ScenarioSchema