Skip to main content

Endpoint

GET /api/inbox_count
Retrieve the count of all inbox messages for the authenticated user (both sent and received).

Headers

Authorization
string
required
User authentication token received from login

Response

inbox_count
integer
Total number of messages in the user’s inbox (sent + received)
error
string
Error message if the request failed

Status codes

  • 200: Count retrieved successfully
  • 401: Unauthorized (invalid or missing token)

Example request

curl https://api.example.com/api/inbox_count \
  -H "Authorization: your-token-here"

Example responses

{
  "inbox_count": 12
}

Notes

  • Count includes both messages sent by the user and received by the user
  • Useful for displaying notification badges in the UI
  • Count is updated in real-time as messages are sent or deleted
  • This is a lightweight endpoint - use it for polling or badge updates

Build docs developers (and LLMs) love