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>

Use the secret_key as the token. You can read it in the Magento admin, under Stores > Configuration > Mirasvit Extensions > eChat on the Account panel, where it is masked until you click it.

The instance_id is not accepted as a token. The chat widget includes it in every storefront page, so it identifies your workspace but does not authenticate a request.

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