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.
Authorizations
Section titled “Authorizations ”Responses
Section titled “ Responses ”The number of unread messages sent to you.
object
Unread messages sent to you, across all your conversations.
Authentication required, missing, or invalid
object
Human-readable error summary
Example
the request could not be completedExample
{ "error": "authentication required: sign in and retry with a valid session or API token"}