Lexey
Use casesPricingDocs
Sign inGet started
Get started
  • Use cases
  • Pricing
  • Docs
  • Sign in
Management Chat API
Basics
  • Getting started
  • The portal
Features
  • Working with Lexey
  • Knowledge base
  • Conversations
  • Customer chat
  • Skills & automations
  • Testing and releases
  • Quality assurance
  • AI safety
  • Billing & usage
Deployment
  • Embedding your chat
API
  • Customer Chat API
  • Management Chat API
  • Webhook events
  • API key management
  • Streaming guide
  • Agent integration
Help
  • FAQ
API/Management Chat API

Management Chat API

The Management Chat API gives you Lexey over HTTP: the same agent as the Lexey pane in the portal, so you can configure your organization from code. It also has read-only endpoints for your knowledge, rules, configuration and customer conversations.

Caution

Changes made through the API go live straight away. The API doesn't use drafts, unlike the Lexey pane in the portal.

Authentication

All requests require a management API key (lxm_ prefix):

Authorization: Bearer lxm_...
Caution

Management keys grant full configuration access — treat them with the same care as admin credentials.

Base URL

https://lexey.ai/api/v1/management

Quick start

1# Create a conversation
2curl -X POST https://lexey.ai/api/v1/management/conversations \
3 -H "Authorization: Bearer $LEXEY_MANAGEMENT_KEY"
4 
5# Send a message
6curl -N -X POST https://lexey.ai/api/v1/management/conversations/CONVERSATION_ID/messages \
7 -H "Authorization: Bearer $LEXEY_MANAGEMENT_KEY" \
8 -H "Content-Type: application/json" \
9 -d '{"message": "Set our business context: We are a pet supplies store..."}'

Common tasks

Set business context:

{"message": "Our business is a SaaS company called Acme. We build project management tools for small teams."}

Add a knowledge article:

{"message": "Add a knowledge article about pricing: Our plans are Free (up to 3 projects), Pro ($12/month, unlimited projects), and Enterprise (custom pricing)."}

Update branding:

{"message": "Set our agent name to 'Acme Support', primary colour to '#2563EB', and welcome heading to 'Need help with Acme?'"}

Set business rules:

{"message": "Add these escalation rules: always escalate if a customer mentions billing disputes, refund requests over $100, or legal issues."}

Review analytics:

{"message": "How have we performed over the last 7 days?"}

Reading data directly

These endpoints return JSON and don't go through Lexey, so they're quick and use no credits. They use the same lxm_ key and base URL.

EndpointReturns
GET /knowledge-articlesarticles: id, title, content, category, status and dates, most recently updated first
GET /business-rulesrules: id, category, content, action and dates
GET /configBranding, business context, tone, suggested questions, skills with their settings, and API connections (without credentials)
GET /customer-conversationsconversations, newest first: status, summary, message count, QA score, intent, contact details, feedback counts and open finding types. Add includeTests=true to include Preview and shadow conversations
GET /customer-conversations/:idOne conversation with its messages (with QA score and feedback) and its findings
GET /identityThe key's organization, type, environment and expiry, without using credits

Paging. The two list endpoints return up to limit items (default 20, at most 100), with hasMore and nextCursor. Pass the cursor back as cursor_id plus cursor_updated_at (articles) or cursor_created_at (conversations):

1curl "https://lexey.ai/api/v1/management/customer-conversations?limit=50&cursor_created_at=2026-10-01T09:00:00.000Z&cursor_id=550e8400-e29b-41d4-a716-446655440000" \
2 -H "Authorization: Bearer $LEXEY_MANAGEMENT_KEY"

Streaming

The send message endpoint returns an SSE stream, identical to the customer API. Each event includes a monotonically incrementing id: field and a data: line. For the full event format and code examples in TypeScript, Python, Go, Ruby, and C#, see the Streaming guide.

E2E testing

The management and customer APIs together enable end-to-end testing without browser automation:

  1. Configure via management API — set up business context, knowledge, rules.
  2. Test via customer API — send customer messages and verify agent responses.
  3. Review via management API — check analytics, conversation history.

Limits and errors

  • Messages to Lexey can be up to 20,000 characters, and a conversation up to 500 messages. After that the API returns 429 with code: "CONVERSATION_LIMIT_REACHED"; start a new conversation.
  • A reply can take up to 300 seconds, because Lexey runs tools while it answers.
  • Billing problems (no subscription, a past-due payment, credits used up) return JSON with status 402 before any stream starts, with an X-Billing-Reason header.
  • Requests are rate limited; a 429 without the conversation-limit code means slow down and retry.

Building an LLM agent integration? See the Agent integration guide for a compact API reference.

← Previous: Customer Chat APINext: Webhook events →
On this pageAuthenticationBase URLQuick startCommon tasksReading data directlyStreamingE2E testingLimits and errors
Lexey

Lexey learns your business from your website and answers customers around the clock.

ProductFeaturesPricingUse casesCompareGuides
DocsGetting startedCustomer APIManagement API
AccountSign upSign in
© 2026 Lexey
TermsTerms of servicePrivacyPrivacy policy