Execute a test run

Triggers the execution of a specified test run. The execution can be customized to include or exclude specific scenarios.

Execute a test run

Triggers the execution of a specified test run. The execution can be customized to include or exclude specific scenarios.

POST https://api.futureagi.com/simulate/run-tests/{run_test_id}/execute/
Bearer
run_test_id *
          Click "Try It" to send a request
        

Authentication

This endpoint requires authentication. Include your API key in the Authorization header:

Authorization: Bearer YOUR_API_KEY

Parameters

Path Parameters

ParameterTypeRequiredDescription
run_test_idstringYesThe UUID of the test run to execute.

Request Body

  • selectAll: boolean Determines how scenarioIds is interpreted. If true, all scenarios except those in scenarioIds will be executed. If false, only the scenarios in scenarioIds will be executed. If scenarioIds is empty, all scenarios will run regardless of this flag.
  • scenarioIds: array of string A list of scenario UUIDs to either include or exclude from the execution, based on the selectAll flag.
  • simulatorId: string An optional UUID of a specific simulator to use for the test run.

Example

{
  "selectAll": true,
  "scenarioIds": [],
  "simulatorId": "your-simulatorId"
}

Responses

200

Test execution started successfully.

  • message: string Example: Test execution started successfully
  • execution_id: string
  • run_test_id: string
  • status: string Example: PENDING
  • total_scenarios: integer
  • total_calls: integer
  • scenario_ids: array of string

400

Bad Request. The execution failed to start, possibly due to an issue with the test configuration.

401

Unauthorized. Authentication credentials were not provided or are invalid.

404

Not Found. The specified test run or organization could not be found.

500

Internal Server Error. An unexpected error occurred while trying to execute the test.

Code Examples

cURL

curl -X POST "https://api.futureagi.com/simulate/run-tests/{run_test_id}/execute/" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"selectAll": true, "scenarioIds": [], "simulatorId": "your-simulatorId"}'

Python

import requests

url = "https://api.futureagi.com/simulate/run-tests/{run_test_id}/execute/"
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
}
data = {
    "selectAll": true,
    "scenarioIds": [],
    "simulatorId": "your-simulatorId"
}

response = requests.post(url, headers=headers, json=data)
print(response.json())

JavaScript

const response = await fetch("https://api.futureagi.com/simulate/run-tests/{run_test_id}/execute/", {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "selectAll": true,
    "scenarioIds": [],
    "simulatorId": "your-simulatorId"
})
});

const data = await response.json();
console.log(data);
Was this page helpful?

Questions & Discussion