API access
The Chat API provides endpoints for message handling, chat history, and bot interactions. Built on Next.js 15 and deployed on Vercel, it follows a serverless architecture with multi-agent support
Endpoints
Send Message
POST /api/telegram/message
// Request
{
chatId: number;
text: string;
keyboard?: InlineKeyboard;
agentId?: string;
}
// Response
204 No Content
400 Bad Request
401 Unauthorized
403 Forbidden
429 Too Many Requests
500 Internal Server ErrorWebhook Handler
Data Types
Message Types
Keyboard Types
Database Operations
Store Message
Get Chat History
Update Chat History
Error Handling
Error Types
Common Errors
Rate Limiting
Function Calls
Message Sending
Security
Authentication
Input Validation
Error Messages
Best Practices
Related Documentation
Last updated