Navigate to the UI frontend and create a preset with your desired configurations.
Use the preset name and send a chat initiation request with the necessary payload.
POST /api/v1/start-chat
Headers:
X-API-KEY: your_api_key
Body:
{
"preset_name": "MyCustomPreset",
"user_data": {
"name": "John Doe",
"age": 30
}
}
// Expected Response
{
"chat_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"message": "Chat session started successfully"
}
Execute the decision logic for the chat session.
POST /api/v1/run-decision?chat_id={uuid}
Headers:
X-API-KEY: your_api_key
Rule-Preset: MyCustomPreset
// Expected Response
{
"preset": "MyCustomPreset",
"final_node": "high_iq_flow",
"decision_path": [
{
"node_id": "start",
"timestamp": "2024-03-15T14:30:00Z"
},
{
"node_id": "iq_check",
"timestamp": "2024-03-15T14:30:02Z"
}
]
}
GET /api/v1/saved-presets
Headers:
X-API-KEY: your_api_key
// Expected Response
{
"presets": [
{
"id": "5db454e9-bf67-49d2-9f66-89b2973f90a1",
"name": "TestPreset"
},
{
"id": "88982de3-b07b-49b7-aa5c-5bcc7ebe9a5d",
"name": "MyNewPreset"
}
]
}
POST /api/v1/start-chat?preset_id={uuid}
Headers:
X-API-KEY: your_api_key
Body:
{
"uploaded_data": {
"some_key": "some_value"
}
}
// Expected Response
{
"chat_id": "abc123",
"status": "success"
}
Operator | Meaning | Example |
---|---|---|
= | Equals | "role" = "admin" |
!= | Not Equals | "status" != "inactive" |
> | Greater Than (numbers) | "score" > 80 |
< | Less Than (numbers) | "attempts" < 5 |
>= | Greater or Equal | "level" >= 3 |
<= | Less or Equal | "credits" <= 100 |
in | Value exists in a list | "permission" in ["read", "write"] |
not in | Value does not exist in a list | "tag" not in ["beta", "legacy"] |
contains | String contains substring | "description" contains "automated" |
nul | Is NULL / missing | "last_login" nul |
not nul | Is not NULL | "email" not nul |