{
"id": "507f1f77bcf86cd799439011",
"dialog_id": "507f1f77bcf86cd799439012",
"mcp_server_id": "string",
"channel_id": "string",
"platform_type": "vk",
"project_id": "string",
"agent_id": "string",
"app_id": "507f1f77bcf86cd799439014",
"app_agent_id": "string",
"lead_id": "507f1f77bcf86cd799439013",
"action_type": "message_created",
"target_type": "message",
"target_id": "string",
"external_message_id": "12345",
"sender": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"type": "lead",
"external_id": "123456789",
"profile": {
"first_name": "Иван",
"last_name": "Петров",
"username": "ivan_petrov",
"avatar_url": "https://example.com/avatar.jpg",
"platform_type": "vk"
}
},
"message": {
"content": "Привет! Как настроить MCP сервер?",
"model": "gpt-4o",
"subject": "Вопрос по заказу #123",
"raw_text": "Raw email body"
},
"attachments": [],
"buttons": [],
"button_click": {
"callback_data": "confirm_order",
"button_text": "Подтвердить заказ",
"callback_id": "123456789",
"message_id": 0,
"action": "callback",
"url": "https://example.com",
"event_key": "events.interaction.button_click",
"platform_event_id": "cbq_12345"
},
"tool": {
"name": "search_servers",
"kind": "builtin",
"category": "ui",
"status": "executing",
"input": {
"query": "MCP server",
"limit": 10
},
"output": "string",
"duration_ms": 1500,
"executed_at": "2025-12-29T10:00:00.000Z",
"completed_at": "2025-12-29T10:00:01.500Z",
"failed_at": "2025-12-29T10:00:01.500Z",
"error_message": "Connection timeout"
},
"costs": {
"text": {
"model": "gpt-4o",
"prompt_tokens": 150,
"completion_tokens": 50,
"total_tokens": 200,
"cached_tokens": 50,
"uncached_tokens": 100,
"audio_tokens": 0,
"reasoning_tokens": 0,
"completion_audio_tokens": 0,
"accepted_prediction_tokens": 0,
"rejected_prediction_tokens": 0,
"provider_currency": "USD",
"provider_input_cost": 15,
"provider_output_cost": 60,
"provider_cached_cost": 2,
"provider_total_cost": 75,
"client_input_cost": 150,
"client_output_cost": 600,
"client_cached_cost": 50,
"client_total_cost": 750,
"client_input_credits": 5,
"client_output_credits": 20,
"client_cached_credits": 2,
"client_total_credits": 25
},
"vision": {
"model": "gpt-4o",
"prompt_tokens": 150,
"completion_tokens": 50,
"total_tokens": 200,
"cached_tokens": 50,
"uncached_tokens": 100,
"audio_tokens": 0,
"reasoning_tokens": 0,
"completion_audio_tokens": 0,
"accepted_prediction_tokens": 0,
"rejected_prediction_tokens": 0,
"provider_currency": "USD",
"provider_input_cost": 15,
"provider_output_cost": 60,
"provider_cached_cost": 2,
"provider_total_cost": 75,
"client_input_cost": 150,
"client_output_cost": 600,
"client_cached_cost": 50,
"client_total_cost": 750,
"client_input_credits": 5,
"client_output_credits": 20,
"client_cached_credits": 2,
"client_total_credits": 25
},
"image_generation": {
"model": "dall-e-3",
"quality": "standard",
"size": "1024x1024",
"provider_currency": "USD",
"provider_total_cost": 4,
"client_total_cost": 400,
"client_total_credits": 10
},
"audio_generation": {
"model": "tts-1",
"pricing_type": "characters",
"char_count": 500,
"text_input_tokens": 300,
"audio_output_tokens": 625,
"duration_seconds": 30,
"voice": "alloy",
"speed": 1,
"provider_currency": "USD",
"provider_total_cost": 1,
"client_total_cost": 100,
"client_total_credits": 5
},
"speech_recognition": {
"model": "whisper-1",
"pricing_type": "characters",
"duration_seconds": 60,
"language": "ru",
"text_input_tokens": 20,
"text_output_tokens": 320,
"audio_input_tokens": 1000,
"provider_currency": "USD",
"provider_total_cost": 1,
"client_total_cost": 100,
"client_total_credits": 5
},
"metrics_extraction": {
"model": "gpt-4o",
"prompt_tokens": 150,
"completion_tokens": 50,
"total_tokens": 200,
"cached_tokens": 50,
"uncached_tokens": 100,
"audio_tokens": 0,
"reasoning_tokens": 0,
"completion_audio_tokens": 0,
"accepted_prediction_tokens": 0,
"rejected_prediction_tokens": 0,
"provider_currency": "USD",
"provider_input_cost": 15,
"provider_output_cost": 60,
"provider_cached_cost": 2,
"provider_total_cost": 75,
"client_input_cost": 150,
"client_output_cost": 600,
"client_cached_cost": 50,
"client_total_cost": 750,
"client_input_credits": 5,
"client_output_credits": 20,
"client_cached_credits": 2,
"client_total_credits": 25
},
"billing_mode": "tokens",
"client_currency": "RUB",
"provider_total_cost": 75,
"client_total_cost": 750,
"usd_to_rub_rate": 95.5,
"client_total_credits": 10,
"credit_rate": 100,
"credit_rate_currency": "RUB"
},
"message_interactions": {
"reactions": {
"count": 5,
"items": [
"👍",
"❤️"
],
"users": [
"u1",
"tg_chat:-1001"
],
"last_at": "2025-12-30T12:00:00.000Z"
},
"editing": {
"is_edited": true,
"edited_at": "2025-12-30T12:01:00.000Z",
"edit_count": 2,
"original_content": "Original text",
"edited_by": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"type": "lead",
"external_id": "123456789",
"profile": {
"first_name": "Иван",
"last_name": "Петров",
"username": "ivan_petrov",
"avatar_url": "https://example.com/avatar.jpg",
"platform_type": "vk"
}
}
},
"replies": {
"is_reply": true,
"reply_to_id": "507f1f77bcf86cd799439011",
"reply_count": 3,
"thread_id": "thread-123"
},
"forwarding": {
"is_forwarded": true,
"forward_count": 4,
"from_chat": "news-channel",
"from_user": "user123",
"last_at": "2025-12-30T12:02:00.000Z"
},
"views": {
"count": 100,
"unique_viewers": 70,
"last_at": "2025-12-30T12:03:00.000Z"
},
"pinning": {
"is_pinned": true,
"pinned_at": "2025-12-30T12:04:00.000Z",
"pinned_by": "admin:1"
},
"mentions": {
"has_mentions": true,
"items": [
"@ivan",
"@support"
],
"user_ids": [
"u1",
"u2"
]
},
"platform_edit": {
"state": "pending",
"required": true,
"error": "string",
"reason": "channel_not_supported_for_platform_action",
"channel_type": "vk",
"requested_at": "2019-08-24T14:15:22.123Z",
"updated_at": "2019-08-24T14:15:22.123Z"
},
"platform_delete": {
"state": "pending",
"required": true,
"error": "string",
"reason": "channel_not_supported_for_platform_action",
"channel_type": "vk",
"requested_at": "2019-08-24T14:15:22.123Z",
"updated_at": "2019-08-24T14:15:22.123Z"
}
},
"status": {
"delivery": {
"is_delivered": true,
"delivered_at": "2025-12-30T12:05:00.000Z",
"failed": false,
"failed_at": "2025-12-30T12:08:00.000Z",
"failure_reason": "string"
},
"read": {
"is_read": true,
"read_at": "2025-12-30T12:06:00.000Z",
"marked_by": "operator:123"
},
"deletion": {
"is_deleted": false,
"deleted_at": "2025-12-30T12:07:00.000Z",
"deleted_by": "admin:123"
},
"sending": {
"status": "queued",
"error_user_message": "string",
"error_internal": "string"
}
},
"source_context": {
"direction": "inbound",
"attribution": {
"utm_source": "string",
"utm_medium": "string",
"utm_campaign": "string"
},
"kind": "telegram_chat",
"data_tg": {
"chat_id": "string",
"user_id": "string",
"from_id": "string",
"message_id": "string",
"reply_to_message_id": "string",
"linked_chat_id": "string",
"chat_type": "private",
"callback_id": "string",
"is_bot": true
}
},
"delivery_ref": {
"channel_type": "tg",
"data_tg": {
"reply_to_message_id": "string"
}
},
"ai": {
"skip_reason": "string",
"skip_response": false,
"skip_metrics": false,
"generation_time_ms": 1200
},
"typing": {
"stopped_at": "2019-08-24T14:15:22.123Z",
"duration_ms": 0,
"message_id": "string",
"timeout": true
},
"timer": {
"scheduled_at": "2019-08-24T14:15:22.123Z",
"in_memory": true,
"mute_dialog": true,
"instruction": "string"
},
"trigger_context": {
"source": "callback",
"key": "string",
"event_key": "string",
"trigger": "string",
"display_name": "string",
"start_payload": "string",
"error_message": "string"
},
"moderation": {
"admin_id": "string",
"reason": "string",
"comment": "string",
"unblock_date": "2019-08-24T14:15:22.123Z",
"by_end_date": true
},
"broadcast": {
"restream_id": "string",
"platform": "string",
"viewers": 0,
"timestamp": "2019-08-24T14:15:22.123Z",
"streamvi_event_id": "string"
},
"reaction": {
"emoji": "string",
"type": "string",
"id": "string",
"message_id": "string",
"conversation_message_id": "string",
"liker_id": "string",
"object_type": "string",
"object_owner_id": 0,
"object_id": 0,
"thread_reply_id": 0
},
"chat_change": {
"added_by_user_id": "string",
"member_first_name": "string",
"member_last_name": "string",
"chat_title": "string",
"new_title": "string"
},
"error": {
"code": "ai_generation_failed",
"error_type": "ai.connection_terminated",
"message": "Превышено время ожидания ответа",
"original_message": "Request timed out.",
"details": {
"http_status": 504
}
},
"hierarchy": {
"parent_event_id": "507f1f77bcf86cd799439011",
"is_rolled_back": false,
"rolled_back_by_event_id": "507f1f77bcf86cd799439012",
"rollback_payload": {
"previous_state": "old_value",
"original_content": "Original message text"
}
},
"generation": {
"summary": {
"text": "string",
"status": "pending",
"role": "user"
},
"metrics": {
"items": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "user_sentiment",
"value": "string",
"confidence_score": 0.95,
"display_type": "enum",
"display_name": "Настроение пользователя",
"enum_values": [
"positive",
"neutral",
"negative"
],
"number_range": {
"min": 0,
"max": 100,
"integer": false
},
"direction": "higher_is_better",
"is_analyzable": true
}
],
"status": "pending"
}
},
"tags": [],
"credit_transaction_id": "string",
"timestamp": "2019-08-24T14:15:22.123Z",
"created_at": "2019-08-24T14:15:22.123Z",
"updated_at": "2019-08-24T14:15:22.123Z",
"event_version": 3
}