MKIT API Documentation

1. Create a Preset

Navigate to the UI frontend and create a preset with your desired configurations.

2. Start a Chat

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"
}

3. Run Decision

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"
      }
  ]
}

Helpers API

Get Presets

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"
      }
  ]
}

Start Chat with Preset

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"
}

Supported Operators

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
inValue exists in a list"permission" in ["read", "write"]
not inValue does not exist in a list"tag" not in ["beta", "legacy"]
containsString contains substring"description" contains "automated"
nulIs NULL / missing"last_login" nul
not nulIs not NULL"email" not nul