Send a message
Requires a logged-in token.
curl -X POST https://api.wapka.org/v1/messages \
-H "Authorization: Bearer eyJ..." \
-H "Content-Type: application/json" \
-d '{
"userid": 42,
"content": "Hey! How are you?"
}'
| Field | Required | Type | Description |
|---|---|---|---|
userid |
Yes | int | Recipient user ID |
content |
Yes | string | Message content |
Alternative: use username instead of userid:
{
"username": "johndoe",
"content": "Hey!"
}
Returns 201 Created with the message object including embedded sender and receiver references.
Get chat with a user
Returns all messages between you and another user, ordered by time.
curl "https://api.wapka.org/v1/messages?userid=42&page=1&limit=50" \
-H "Authorization: Bearer eyJ..."
Response
{
"data": [
{
"id": 555,
"content": "Hey! How are you?",
"sender": { "id": 36012, "username": "me", "avatar": "https://..." },
"receiver": { "id": 42, "username": "johndoe", "avatar": "https://..." },
"created_at": "2026-05-23T10:00:00Z"
}
],
"pagination": { "page": 1, "limit": 50, "totalItems": 15, "totalPages": 1, "hasNext": false, "hasPrev": false },
"meta": { "requestId": "req_...", "timestamp": "..." }
}
Message fields
| Field | Type | Description |
|---|---|---|
id |
int | Unique message ID |
content |
string | Message body |
sender |
object | Sender reference ({ id, username, avatar }) |
receiver |
object | Recipient reference ({ id, username, avatar }) |
created_at |
string | Send timestamp |
Get a message by ID
curl https://api.wapka.org/v1/messages/555 \
-H "Authorization: Bearer eyJ..."
Edit a message
Requires a logged-in token (must be the sender).
curl -X PATCH https://api.wapka.org/v1/messages/555 \
-H "Authorization: Bearer eyJ..." \
-H "Content-Type: application/json" \
-d '{
"content": "Updated message content"
}'
Delete a message
Requires a logged-in token.
curl -X DELETE https://api.wapka.org/v1/messages/555 \
-H "Authorization: Bearer eyJ..."
Returns 204 No Content.
Conversations
List conversation partners
Returns all users you have messaged with.
curl https://api.wapka.org/v1/conversations \
-H "Authorization: Bearer eyJ..."
Unread count
Returns the number of unread messages.
curl https://api.wapka.org/v1/conversations/unread \
-H "Authorization: Bearer eyJ..."
Response:
{
"data": {
"unread_count": 3
},
"meta": { "requestId": "req_...", "timestamp": "..." }
}
Lua API wrapper
-- Send a message
api.messages:send({ userid = 42, content = "Hello!" })
-- Get chat
local chat = api.messages:getChat(42, { page = 1, limit = 50 })
-- Get a message
local msg = api.messages:get(555)
-- Edit a message
api.messages:edit(555, "Updated content")
-- Delete a message
api.messages:delete(555)
-- List conversations
local partners = api.messages:conversations()
-- Unread count
local unread = api.messages:unreadCount()
Next: Files & Folders — upload, manage, and organize files.