API Documentation

Message API Guide

The Chatbot Interaction API allows you to interact with your chatbots using a POST request. This API provides a way to communicate with your chatbot programmatically.

Endpoint

POST /api/v1/chat

Request Headers

The API request must include the following headers:

  • Authorization: Bearer <Your-API-Key> - Your API key for authentication
  • Content-Type: application/json - The content type of the request

Request Body

{
  "messages": [
    { "content": "How can I help you?", "role": "assistant" },
    { "content": "What is your product?", "role": "user" }
  ],
  "stream": false,
  "temperature": 0
}

Example Request

const response = await fetch('/api/v1/chat', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer <Your-API-Key>',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    messages: [
      { content: 'How can I help you?', role: 'assistant' },
      { content: 'What is your product?', role: 'user' }
    ],
    stream: false,
    temperature: 0
  })
});

const data = await response.json();