> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vellaro.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Post Message

> Send a message and stream the assistant response via SSE.

Event stream shape:
    event: text         data: {"text": "..."}          (a piece of the answer as
                               it is written, ids already removed: append them)
    event: text_reset   data: {"text": "..."}          (only with features
                               ["text_reset"]: show THIS as the answer so far,
                               then append the next pieces — alphabet guard)
    event: tool_start   data: {"tool": {"name": "search_products", "input": {...}}}
    event: tool_result  data: {"tool": {"name": "...", "output": {...}}}
    event: refusal      data: {"text": "...", "meta": {"label": "off_topic"}}
    event: complete     data: {"message_id": "...", "meta": {"products": [...],
                               "turn_locale": "sq"}}
    event: error        data: {"text": <code>, "meta": {"code": <code>,
                               "message": <localized>, "contact": {"email", "phone"}}}

`products`: the card add_to_cart prepared (with its `proposal`), then the
products the answer names, in its order (none after a refusal);
`turn_locale`: the language of the turn (BE-34). Error codes: `chat_disabled`,
`budget_exhausted`, `unavailable` (provider misconfigured or any
unexpected failure, also in the middle of an answer — the cause is
logged, never sent). `error` is always the last event: no `complete`
follows, and a half answer is not saved.

Too many messages (CHAT-11, `rate_limit.check_message`): 429 before any
model call, with `{code: "rate_limited", message, contact}` and
`Retry-After`.



## OpenAPI

````yaml https://api.vellaro.io/openapi/storefront.json post /api/v1/chat/conversations/{conv_id}/message
openapi: 3.1.0
info:
  title: Vellaro Storefront API
  description: >-
    The API of storefronts and mobile apps. The store comes from the publishable
    key in the `X-Vellaro-Key` header (or from the store's domain); the
    customer's endpoints also take the customer's token as `Authorization:
    Bearer <access_token>`.
  version: 0.1.0
servers:
  - url: https://api.vellaro.io
    description: Produzione
security: []
tags:
  - name: Authentication
    description: >-
      Customer sign-up and login, tokens, password reset, email verification,
      Google and Apple login, two-factor authentication.
  - name: Catalog
    description: Products, categories and brands, with filters, sorting and pagination.
  - name: Search
    description: Full-text product search and suggestions as you type.
  - name: Cart
    description: >-
      The cart of a guest (`X-Cart-Token`) or of the logged-in customer, and the
      extra warranty offered on a product page.
  - name: Checkout & orders
    description: >-
      Checkout, the customer's orders and reorder, «Order on WhatsApp» (cart
      codes, clicks).
  - name: Payments
    description: >-
      The store's payment methods, paying an order again, and the confirmation
      steps of PayPal, PokPay and Iute.
  - name: Account
    description: >-
      The logged-in customer: profile, addresses, wishlist, digital downloads,
      subscriptions, affiliate account.
  - name: Reviews & questions
    description: Product reviews and product questions.
  - name: AI chat
    description: 'The store''s AI shopping assistant: conversations, messages, feedback.'
  - name: Content
    description: CMS pages, menus, banners, flipbooks and information pages.
  - name: Marketing & contact
    description: >-
      Newsletter sign-up and email links, the contact form, campaign click
      tracking.
  - name: Store
    description: >-
      The store for the storefront: brand, public settings, languages,
      translations, currencies, physical stores, theme.
  - name: Devices
    description: Push-notification devices of the mobile app.
paths:
  /api/v1/chat/conversations/{conv_id}/message:
    post:
      tags:
        - AI chat
      summary: Post Message
      description: >-
        Send a message and stream the assistant response via SSE.


        Event stream shape:
            event: text         data: {"text": "..."}          (a piece of the answer as
                                       it is written, ids already removed: append them)
            event: text_reset   data: {"text": "..."}          (only with features
                                       ["text_reset"]: show THIS as the answer so far,
                                       then append the next pieces — alphabet guard)
            event: tool_start   data: {"tool": {"name": "search_products", "input": {...}}}
            event: tool_result  data: {"tool": {"name": "...", "output": {...}}}
            event: refusal      data: {"text": "...", "meta": {"label": "off_topic"}}
            event: complete     data: {"message_id": "...", "meta": {"products": [...],
                                       "turn_locale": "sq"}}
            event: error        data: {"text": <code>, "meta": {"code": <code>,
                                       "message": <localized>, "contact": {"email", "phone"}}}

        `products`: the card add_to_cart prepared (with its `proposal`), then
        the

        products the answer names, in its order (none after a refusal);

        `turn_locale`: the language of the turn (BE-34). Error codes:
        `chat_disabled`,

        `budget_exhausted`, `unavailable` (provider misconfigured or any

        unexpected failure, also in the middle of an answer — the cause is

        logged, never sent). `error` is always the last event: no `complete`

        follows, and a half answer is not saved.


        Too many messages (CHAT-11, `rate_limit.check_message`): 429 before any

        model call, with `{code: "rate_limited", message, contact}` and

        `Retry-After`.
      operationId: post_message_api_v1_chat_conversations__conv_id__message_post
      parameters:
        - name: conv_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Conv Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MessageIn'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    MessageIn:
      properties:
        text:
          type: string
          maxLength: 4000
          minLength: 1
          title: Text
        locale:
          anyOf:
            - type: string
              maxLength: 8
              minLength: 2
            - type: 'null'
          title: Locale
        features:
          anyOf:
            - items:
                type: string
                maxLength: 32
                minLength: 1
              type: array
              maxItems: 8
            - type: 'null'
          title: Features
      type: object
      required:
        - text
      title: MessageIn
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.