Skip to content

Count your unread messages

GET
/account/messages/unread-count

Returns how many direct messages sent to you haven’t been marked read, across all your conversations.

You need to be signed in; no capability is needed. Without a session cookie or bearer token that identifies you, the answer is 401, whether or not public mode is on.

Every unread message addressed to you counts, including ones in conversations past the inbox limit and ones from accounts that have been removed, so the number can be more than the unread_count values in listMyDirectMessageThreads add up to.

The number is cached on each server with no expiry. A new message to you, and marking messages read, ask every server to drop its copy, but that request can fail or arrive late, so the number can lag. Marking a conversation read when nothing was unread doesn’t refresh it. Server errors get a plain-text 500.

The number of unread messages sent to you.

object
count
required

Unread messages sent to you, across all your conversations.

integer format: int64

Authentication required, missing, or invalid

object
error
required

Human-readable error summary

string
Example
the request could not be completed
Example
{
"error": "authentication required: sign in and retry with a valid session or API token"
}