Add rows to a scenario using AI

Initiates an asynchronous task to generate and add a specified number of new rows to a scenario's dataset using AI. A description can be provided to g...

Add rows to a scenario using AI

Initiates an asynchronous task to generate and add a specified number of new rows to a scenario’s dataset using AI. A description can be provided to guide the content generation.

POST https://api.futureagi.com/simulate/scenarios/{scenario_id}/add-rows/
Bearer
scenario_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
scenario_idstringYesThe UUID of the scenario to which rows will be added.

Request Body

  • num_rows (required): integer The number of new rows to generate and add. The value must be between 1 and 100.
  • description: string An optional description to guide the AI in generating the content for the new rows.

Example

{
  "num_rows": 1,
  "description": "your-description"
}

Responses

202

Accepted. The request to generate rows has been queued and is being processed in the background.

  • message: string Example: Started generating 5 new rows for scenario
  • scenario_id: string
  • dataset_id: string
  • num_rows: integer Example: 5

400

Bad Request. The request is invalid. This can happen if the scenario does not have an associated dataset or if the ‘num_rows’ is out of the valid range (1-100).

401

Unauthorized. Authentication credentials were not provided or are invalid.

404

Not Found. The scenario with the specified ID could not be found.

500

Internal Server Error. An unexpected error occurred while processing the request.

Code Examples

cURL

curl -X POST "https://api.futureagi.com/simulate/scenarios/{scenario_id}/add-rows/" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"num_rows": 1, "description": "your-description"}'

Python

import requests

url = "https://api.futureagi.com/simulate/scenarios/{scenario_id}/add-rows/"
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
}
data = {
    "num_rows": 1,
    "description": "your-description"
}

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

JavaScript

const response = await fetch("https://api.futureagi.com/simulate/scenarios/{scenario_id}/add-rows/", {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "num_rows": 1,
    "description": "your-description"
})
});

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

Questions & Discussion