Skip to main content

REST API

The eChat platform provides a REST API for managing your knowledge base programmatically. You can use it to create, read, update, and delete documents and categories without relying on the Magento sync mechanism.

This is useful when you want to:

  • Push content from external sources (help desk, blog, custom CMS) into the chatbot's knowledge base.
  • Automate knowledge base management via CI/CD pipelines or scripts.
  • Build custom integrations with third-party systems.

Base URL

All API endpoints are relative to your eChat instance URL:

https://echat.mirasvit.com/api

Authentication

All Knowledge Base endpoints require Bearer token authentication. Include the Authorization header with every request:

Authorization: Bearer <secret_key>

Both credentials work as the token: the secret_key and the instance_id. You can read either of them in the Magento admin, under Stores > Configuration > Mirasvit Extensions > eChat on the Account panel, where the secret key is masked until you click it.

A missing or unparseable Authorization header, or a token matching no instance, is answered with 401.

Response format

All endpoints return a consistent JSON response:

{
"success": true, // whether the request was processed successfully
"message": "", // error description (empty on success)
"data": { ... } // response payload (varies by endpoint)
}

Endpoints

  • Documents - CRUD operations for knowledge base documents
  • Categories - CRUD operations for knowledge base categories