Complete REST API reference for P2A-Bot Java Edition.
http://localhost:8080/api
GET /healthReturns bot status and version info.
GET /health/infoReturns detailed bot information.
GET /database/statusCheck SQLite database connection.
POST /bot/{chatId}/notes?key=greeting&content=Hello%20everyone!GET /bot/{chatId}/notes/{key}GET /bot/{chatId}/notesDELETE /bot/{chatId}/notes/{key}POST /bot/{chatId}/warnings/{userId}?reason=SpamGET /bot/{chatId}/warnings/{userId}DELETE /bot/{chatId}/warnings/{userId}POST /bot/{chatId}/filters?pattern=bad&replacement=***®ex=falseGET /bot/{chatId}/filtersDELETE /bot/{chatId}/filters/{filterId}GET /stats/{chatId}GET /bot/{chatId}/statsPOST /bot/{chatId}/stats/increment/{action}Actions: message, warning, ban, kick
GET /database/tablesGET /database/schemaPOST /database/initPOST /webhook/telegramTelegram sends updates to this endpoint.
curl -X POST http://localhost:8080/api/bot/12345/notes \
-d "key=greeting" \
-d "content=Welcome to our group!"curl -X POST http://localhost:8080/api/bot/12345/warnings/67890 \
-d "reason=Spam"curl http://localhost:8080/api/bot/12345/statscurl http://localhost:8080/api/bot/12345/notescurl http://localhost:8080/api/database/statusAll responses follow this format:
{
"status": "success",
"data": { /* response data */ },
"timestamp": 1234567890
}{
"id": "uuid-string",
"chatId": 12345,
"noteKey": "greeting",
"noteContent": "Welcome!",
"createdAt": "2024-11-25T10:30:00",
"updatedAt": "2024-11-25T10:30:00"
}{
"id": 1,
"chatId": 12345,
"totalMessages": 1500,
"usersWarned": 5,
"usersKicked": 2,
"usersBanned": 1,
"notesSaved": 8,
"createdAt": "2024-11-25T10:00:00",
"updatedAt": "2024-11-25T10:30:00"
}No authentication required (open API).
No rate limits configured (unlimited requests).
200- OK400- Bad Request404- Not Found500- Server Error
The TypeScript version uses Mastra framework:
POST /api/workflow/trigger
GET /api/agent/status
See TypeScript API docs for details.
API Version: 2.0.0
Last Updated: November 25, 2024