Skip to main content

Endpoint

POST /chat Conversational interface for the LoopOS AI Submission service. This endpoint follows the DeepChat standard for conversational interfaces.

Request

language
string
default:"PT-PT"
Language code for the request (e.g., “PT-PT”, “en-US”)
messages
array
required
List of conversation messages. Each message should have:
  • role: “user” or “assistant”
  • text: Message text
  • html (optional): HTML content
images
array
default:"[]"
List of image URLs or base64 data URLs
conversation
boolean
default:"true"
Whether this is part of a conversation thread
session_id
string
Optional session identifier for conversation tracking
loopos_core_context
string
Business context or additional information for the AI agent
loopos_core_base_url
string
required
LoopOS Core base URL (e.g., “https://core.decs.stg.loopos.app/”)
loopos_submission_base_url
string
required
LoopOS Submission base URL (e.g., “https://submission.decs.stg.loopos.app/“)

Response

messages
array
Array of message objects with:
  • text: Message text
  • role: “assistant” or “user”
  • html (optional): HTML content with buttons or structured elements

Example Request

{
  "language": "PT-PT",
  "messages": [
    {"role": "user", "text": "Quero vender um iPhone 12"}
  ],
  "images": [],
  "conversation": true,
  "session_id": "my-session-123",
  "loopos_core_context": "Circular economy marketplace",
  "loopos_core_base_url": "https://core.decs.stg.loopos.app/",
  "loopos_submission_base_url": "https://submission.decs.stg.loopos.app/"
}

Example Response

[
  {
    "text": "Ótimo! Vou ajudar-te a submeter o teu iPhone 12. Deixa-me procurar no catálogo...",
    "role": "assistant",
    "html": "<div>...</div>"
  }
]

Workflow

The chat endpoint uses a multi-agent workflow:
  1. Product Identification: Identifies product from user description
  2. Options Selection: Collects product options/variants
  3. Item Creation: Creates item in LoopOS Core
  4. Protocol Questions: Asks and validates protocol questions