Run bot
Queues a bot execution, as if it were triggered manually on the platform. The execution follows the same queue rules and shows up in Executions as soon as it starts.
Only bot_name is required. Without bot_version and agent_name, Sinfonia uses the bot’s release version and the agent configured in it. Without bot_params, it uses the bot’s default parameters.
POST
/v1/runBase URL:
https://sinfonia.live/apiHeaders
token
stringrequiredAPI type token, generated in Administration → Tokens.Example:
YOUR_TOKENContent-Type
stringrequiredAlways
application/json.Example:
application/jsonRequest body
bot_name
stringrequiredName of the bot to run.
Example:
bot-notas-fiscaisbot_version
stringoptionalBot version. If omitted, the release version is used.
Example:
1.0.0agent_name
stringoptionalAgent that will run the bot. If omitted, the release version’s agent is used.
Example:
SVWPRD0027bot_params
stringoptionalExecution parameters, as a JSON object serialized into a string. If omitted, the bot’s default parameters are used.
Example:
{"PARAM1": "123", "PARAM2": "value2"}label
stringoptionalFree-form label to identify the execution on the platform.
Example:
api-testwebhook_url
stringoptionalURL that receives a
POST when the execution finishes. See Completion webhook.Example:
https://meusistema.com/webhooks/sinfoniaRequest example
curl -X POST "https://sinfonia.live/api/v1/run" \
-H "token: YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"bot_name": "bot-notas-fiscais",
"bot_version": "1.0.0",
"agent_name": "SVWPRD0027",
"bot_params": "{\"PARAM1\": \"123\", \"PARAM2\": \"value2\"}",
"label": "api-test",
"webhook_url": "https://meusistema.com/webhooks/sinfonia"
}'Responses
Execution added to the queue. The response has no body.
Notes
- The success response doesn’t include the execution number. To know when it finished and with what result, provide a
webhook_url: Sinfonia sends theexec_idand thestatusto it at the end. See Completion webhook. bot_paramsis a string containing JSON, not an object. Serialize the parameters before sending, for example withJSON.stringifyorjson.dumps.- The parameters reach the bot just like in other execution methods. See how to read them in Script Examples.
Last updated on