MORSEMIND INTEGRATION & REST API REFERENCE

API & Embed Integration

Add your AI assistant to any website with a single script, or integrate MorseMind's hybrid RAG search and document indexing directly via REST endpoints.

Base URL & Authentication
https://api.morsemind.ai/v1

Authenticate REST requests with Authorization: Bearer header.

Embed

Add your assistant to any website with one script.

EMBED YOUR ASSISTANT

Add the chatbot to any website

Copy this script and paste it just before the closing </body> tag of your website.

<script async src="http://localhost:4000/embed/imorse-rag-widget.js" data-bot-id="bot_9744a767a6ab48eaa454b14e18ce7c64"></script>

Ready to embed

Your assistant loads as a lightweight floating widget and uses the Appearance settings you saved.

Bot ID: bot_9744a767a6ab48eaa454b14e18ce7c64
TipKeep the script asynchronous so it never blocks your site from loading.

REST API Reference

Explore REST endpoints for managing assistants, uploading sources, and performing RAG searches.

Endpoints List

Rate Limits:

Standard tier: 600 requests / minute per API key.

Chat & Retrieval API

Send Message & Get RAG Response

POST/v1/assistants/{assistant_id}/chat

Queries the specified assistant with natural language. MorseMind retrieves relevant knowledge passages using hybrid search and returns a grounded answer with citations.

Request Parameters

messagestring • required

The user prompt or query.

streamboolean

Stream response tokens via Server-Sent Events (SSE). Default is false.

top_kinteger

Number of relevant knowledge passages to retrieve. Default is 5.

import { MorseMind } from '@morsemind/sdk';

const morsemind = new MorseMind({ 
  apiKey: process.env.MORSEMIND_API_KEY 
});

const response = await morsemind.assistants.chat('asst_9f83a', {
  message: 'When is the NEET exam schedule?',
  stream: false,
  topK: 5,
});

console.log(response.answer);
console.log(response.citations);
RESPONSE EXAMPLE200 OK
{
  "id": "msg_893fa12",
  "assistant_id": "asst_9f83a",
  "answer": "The NEET exam schedule is typically announced by NTA on the official portal.",
  "confidence": 0.98,
  "citations": [
    {
      "source_title": "NEET Guide 2026.pdf",
      "page": 4,
      "snippet": "NTA conducts NEET UG annually..."
    }
  ]
}