Skip to main content
POST
/
v1
/
models
/
{model_id}
/
scenario
Scenario
curl --request POST \
  --url https://api.example.com/v1/models/{model_id}/scenario \
  --header 'Content-Type: application/json' \
  --data '
{
  "dataset": {
    "columns": [
      {
        "name": "<string>"
      }
    ],
    "connection_config": {
      "uri": "<string>",
      "connector_credential_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "connector_credential_name": "<string>",
      "connector_type": "s3",
      "region": "<string>",
      "file_format": "<string>"
    },
    "filter": {
      "col": "<string>",
      "kind": "cmp",
      "value": "<string>"
    }
  },
  "desired_class": 1,
  "n_trials": 500,
  "max_steps": 30,
  "random_state": 42,
  "constraints": {}
}
'
{
  "job_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "message": "<string>"
}

Headers

authorization
string | null
refresh-token
string | null

Path Parameters

model_id
string<uuid>
required

Body

application/json

POST /v1/models/{model_id}/scenario -- Counterfactual search with constraints.

dataset
Dataset · object
required

Inline dataset spec — each materialized row is one query for the counterfactual search. Caps on row count are enforced inside the worker after materialize().

desired_class
integer
default:1
n_trials
integer
default:500
Required range: x >= 1
max_steps
integer
default:30
Required range: x >= 1
random_state
integer | null
default:42
constraints
Constraints · object

Response

Successful Response

Base response returned by async job-submission endpoints.

Keyed on job_id. Model identity (when applicable) is materialized at completion and returned inside JobResultResponse.result_data.

job_id
required

Server-assigned id of the submitted job

status
enum<string>
required
Available options:
pending,
running,
completed,
failed
message
string
required