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.
Authentication
All requests require a management API key (lxm_ prefix):
Authorization: Bearer lxm_...
Base URL
https://lexey.ai/api/v1/management
Quick start
| 1 | # Create a conversation |
| 2 | curl -X POST https://lexey.ai/api/v1/management/conversations \ |
| 3 | -H "Authorization: Bearer $LEXEY_MANAGEMENT_KEY" |
| 4 | |
| 5 | # Send a message |
| 6 | curl -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.
| Endpoint | Returns |
|---|---|
GET /knowledge-articles | articles: id, title, content, category, status and dates, most recently updated first |
GET /business-rules | rules: id, category, content, action and dates |
GET /config | Branding, business context, tone, suggested questions, skills with their settings, and API connections (without credentials) |
GET /customer-conversations | conversations, 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/:id | One conversation with its messages (with QA score and feedback) and its findings |
GET /identity | The 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):
| 1 | curl "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:
- Configure via management API — set up business context, knowledge, rules.
- Test via customer API — send customer messages and verify agent responses.
- 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-Reasonheader. - 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.