Lexey
Use casesPricingDocs
Sign inGet started
Get started
  • Use cases
  • Pricing
  • Docs
  • Sign in
Webhook events
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/Webhook events

Webhook events

When you enable the Send webhook on event skill, Lexey sends HTTP POST requests to your configured URL when conversation events occur.

Event types

The following event type is currently supported:

  • conversation.escalated — Fired when the support agent escalates a conversation to a human (due to customer frustration, unresolvable query, or a configured escalation trigger).

When enabling the webhook skill, you choose which events to subscribe to.

Payload format

All webhook payloads are JSON. Here is an example conversation.escalated payload:

1{
2 "event": "conversation.escalated",
3 "timestamp": "2026-02-19T04:30:00.000Z",
4 "conversation": {
5 "id": "550e8400-e29b-41d4-a716-446655440000",
6 "status": "escalated",
7 "customerIdentifier": "user@example.com",
8 "createdAt": "2026-02-19T04:00:00.000Z"
9 },
10 "messages": [
11 {
12 "role": "user",
13 "content": "I need to speak to a manager about my refund.",
14 "createdAt": "2026-02-19T04:00:10.000Z"
15 },
16 {
17 "role": "assistant",
18 "content": "I understand your frustration. Let me escalate this to our team.",
19 "createdAt": "2026-02-19T04:00:12.000Z"
20 }
21 ],
22 "payload": {
23 "reason": "Customer requested manager for refund dispute"
24 }
25}

Payload fields:

  • event — The event type (conversation.escalated).
  • timestamp — When the event occurred (UTC ISO 8601).
  • conversation — Conversation metadata including ID, status, customer identifier, and creation time.
  • messages — The full message history (role, content, and timestamp for each message).
  • payload — Event-specific data. For escalation events this contains a reason field.

HMAC signature verification

If you configure a shared secret when enabling the webhook skill, every request includes an X-Lexey-Signature header for verification:

X-Lexey-Signature: sha256=a1b2c3d4e5f6...

The signature is an HMAC-SHA256 hex digest of the raw request body using your shared secret as the key.

Verification example (Node.js):

1import { createHmac, timingSafeEqual } from "crypto";
2 
3function verifySignature(body: string, signature: string, secret: string): boolean {
4 const expected = "sha256=" + createHmac("sha256", secret).update(body).digest("hex");
5 return timingSafeEqual(Buffer.from(signature), Buffer.from(expected));
6}
Caution

Always use constant-time comparison (timingSafeEqual) to prevent timing attacks when verifying signatures.

Request details

  • Method: POST
  • Content-Type: application/json
  • User-Agent: Lexey-Webhook/1.0

Your endpoint should return a 2xx status promptly. Failed deliveries are retried automatically.

Webhooks are sent for real customer conversations and for Preview conversations with your live agent, so you can test your endpoint from the portal. They're never sent for shadow conversations, Preview against a draft or Test Lab runs. Each account sends at most 100 webhooks and escalation emails an hour.

Integration tips

  • Return a 2xx status quickly from your endpoint — do any heavy processing asynchronously.
  • Use the conversation.id as an idempotency key to handle potential duplicate deliveries.
  • Log the X-Lexey-Signature header and raw body for debugging signature verification issues.
  • All event timestamps are in UTC ISO 8601 format.
← Previous: Management Chat APINext: API key management →
On this pageEvent typesPayload formatHMAC signature verificationRequest detailsIntegration tips
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