For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Platform docsVideosCommunitySign up
CapabilitiesGetting startedVoice AI OrchestrationVoxEngine PlatformAPI ReferenceFAQ
CapabilitiesGetting startedVoice AI OrchestrationVoxEngine PlatformAPI ReferenceFAQ
  • Management API
    • Reference
        • POSTAddScenario
        • POSTDelScenario
        • POSTBindScenario
        • POSTGetScenarios
        • POSTSetScenarioInfo
        • POSTReorderScenarios
        • POSTStartScenarios
        • POSTStartConference
    • Authorization
    • Errors
  • Web SDK
    • Overview
  • Android SDK
    • Overview
  • Android SDK v3
    • Overview
  • iOS SDK
    • Overview
  • React Native SDK
    • Overview
  • Flutter SDK
    • Overview
LogoLogo
Platform docsVideosCommunitySign up
Management APIReferenceScenarios

AddScenario

||View as Markdown|
POST
https://api.voximplant.com/platform_api/AddScenario
POST
/platform_api/AddScenario
$curl -X POST "https://api.voximplant.com/platform_api/AddScenario?scenario_name=WelcomeGreeting&scenario_script=var%20s&rule_id=12345&rewrite=true" \
> -H "Authorization: Bearer <token>" \
> -H "Content-Type: application/json" \
> -d '{}'
200Example 1
1{
2 "result": 1,
3 "scenario_id": 98765
4}
Adds a new scenario to the <a href="https://voximplant.com/docs/gettingstarted/basicconcepts/scenarios#shared-scenarios">Shared</a> folder, so the scenario is available in all the existing applications. Please use the POST method. When adding a scenario to the Shared folder, the `application_id` and `application_name` parameters should not be provided. Allowed roles: `Owner`, `Admin`, `Developer`. **Example request:** Add a new scenario: var s='hello';
Was this page helpful?
Previous

RecoverCallList

Next

DelScenario

Built with

Adds a new scenario to the Shared folder, so the scenario is available in all the existing applications. Please use the POST method.

When adding a scenario to the Shared folder, the application_id and application_name parameters should not be provided.

Allowed roles: Owner, Admin, Developer.

Example request: Add a new scenario: var s=‘hello’;

Authentication

AuthorizationBearer

Voximplant Management API uses signed JWT tokens generated from your service-account private key. Pass the token in the Authorization header as a Bearer value:

Authorization: Bearer $VOXIMPLANT_TOKEN

See Authorization for ready-to-copy snippets in bash, Python, Node.js and Go that turn your credentials.json into a token.

Query parameters

scenario_namestringRequired
The scenario name. The length must be less than 30
scenario_scriptstringOptional

The scenario text. Use the application/x-www-form-urlencoded content type with UTF-8 encoding. The length must be less than 128 KB

rule_idintegerOptional
The rule ID. The new scenario binds to the specified rule. Please note, if you do not bind the scenario to any rule, you cannot execute the scenario
rule_namestringOptional

The rule name that can be used instead of rule_id

rewritebooleanOptionalDefaults to false
Whether to rewrite the existing scenario
application_idintegerOptional
Application ID to bind the scenario to
application_namestringOptional
Application name to bind the scenario to

Response

Successful response
resultinteger
Returns 1 if the request has been completed successfully
scenario_idinteger
The new scenario ID