Skip to main content

Endpoint

POST /loopos_ai_protocol_generator Generates a collection of questions and information elements (protocol) to collect all relevant information about a used item in a specific category.

Request

node_type
string
required
Type of node (e.g., “category”, “product”, “subcategory”)
node_context
object
required
Context dict containing:
  • name (string): Category/product name
  • description (string): Description of the category/product
  • parent_categories (array, optional): List of parent categories
language
string
required
Language code for the protocol (e.g., “en”, “pt”)

Response

elements
array
required
Array of protocol elements. Each element contains:
  • class (string): Protocol element class (e.g., “Protocol::Element::Input::Text”, “Protocol::Element::Input::Select”)
  • attributes (object): Element attributes (label, required, hint, etc.)
  • options (array, optional): Options for select elements

Example Request

{
  "node_type": "category",
  "node_context": {
    "name": "Smartphones",
    "description": "Mobile phones with advanced computing capabilities",
    "parent_categories": ["Electronic devices"]
  },
  "language": "en"
}

Example Response

{
  "elements": [
    {
      "class": "Protocol::Element::Input::Text",
      "attributes": {
        "label": "What is the brand and model of your smartphone?",
        "required": true,
        "hint": "Please enter the exact brand and model name"
      }
    },
    {
      "class": "Protocol::Element::Input::Select",
      "attributes": {
        "label": "What is the storage capacity?",
        "required": true,
        "hint": "Select the storage capacity of your device"
      },
      "options": [
        {"label": "64 GB", "deal_breaker": false},
        {"label": "128 GB", "deal_breaker": false},
        {"label": "256 GB", "deal_breaker": false}
      ]
    }
  ]
}

Protocol Element Types

Input Elements

  • Text: Free-text input
  • Select: Dropdown with options
  • Number: Numeric input
  • Date: Date input
  • Boolean: Yes/No input

Info Elements

  • Info: Informational content
  • Warning: Warning messages