API Reference
Run AI Agents via API request.
Overview
With the MindStudio API you can enable the programmatically invocation of workflows. It allows for the integration of AI workflows as a step in larger automation processes.
Run an app
Executes a specified app with given variables and optional workflow.
Endpoint
Authentication
This endpoint requires Bearer token authentication.Request body
workflow
string
The workflow to run (without .flow extension)
No
variables
object
The variables to pass to the app
No
callbackUrl
string
The URL to receive the execution result
No
appId
string
The ID of the app to run
Yes
Response
Success response (200 OK)
The response will be one of two possible formats:
1 - For asynchronous execution (when callbackUrl
is provided):
2 - For synchronous execution:
Error responses
400 Bad Request
: The request was invalid or cannot be served.
500 Internal Server Error
: The server encountered an unexpected condition that prevented it from fulfilling the request.
Example usage
Note: Replace YOUR_ACCESS_TOKEN
and YOUR_APP_ID
with your actual Bearer token and Agent ID, and adjust the request body according to your specific app requirements.
Load an app
Loads an app by ID. If the app is not found, it returns a 404 error.
Endpoint
Authentication
This endpoint requires Bearer token authentication.
Response
Success response (200 OK)
The response will be a JSON object containing the organization information.
Error response (404 Not Found)
The organization for the specified token was not found.
Example usage
Note: Replace YOUR_ACCESS_TOKEN
with your actual Bearer token.
How to pass launch variables from an API request to a workflow
The syntax for calling a launch variable will be different than calling a variable on runtime. Rather than using {{VARIABLE_NAME}}
in your prompt, launch variables are called using {{$launchVariables->VARIABLE_NAME}}
syntax.
This must be utilized anytime a launch variable is called within a workflow. In the following example, we will look at the body of an API request that passes a launch variable, topic
, when running a MindStudio workflow.
Example API request body
Within the body request, the launch variable topic
is assigned with the value “Dogs”.
Note: Replace YOUR_APP_ID
with your actual app ID.Example promptWithin a prompt area inside of Mindstudio, the topic
launch variable is called using the launch variable syntax.
Last updated