v51

latestOpenAPI 3.0.3raw.githubusercontent.com2026-08-01121113461.4 KB
threads

Get aggregated statistics for threads based on filters.

get/api/v1.0/threads/stats/

Query parameters

has_archivedinteger

Filter threads that are archived (1=true, 0=false).

has_assigned_to_meinteger

Filter threads assigned to the current user (1=true, 0=false).

has_attachmentsinteger

Filter threads with attachments (1=true, 0=false).

has_delivery_pendinginteger

Filter threads with delivery pending messages: sending, retry or failed (1=true, 0=false).

has_draftinteger

Filter threads with draft messages (1=true, 0=false).

has_mentioninteger

Filter threads with any mention (read or unread) for the current user (1=true, 0=false).

has_senderinteger

Filter threads with messages sent by the user (1=true, 0=false).

has_starredinteger

Filter threads with starred messages (1=true, 0=false).

has_trashedinteger

Filter threads that are trashed (1=true, 0=false).

has_unassignedinteger

Filter threads with no active assignment from any user (1=true, 0=false).

has_unread_mentioninteger

Filter threads with unread mentions for the current user (1=true, 0=false).

label_slugstring

Filter threads by label slug.

mailbox_idstring uuid

Filter threads by mailbox ID.

searchstring

Search threads by content (subject, sender, recipients, message body).

stats_fields'all' | 'all_unread' | 'has_assigned_to_me' | 'has_delivery_failed' | 'has_delivery_pending' | 'has_mention' | 'has_unassigned' | 'has_unread_mention' required

Comma-separated list of fields to aggregate. Special values: 'all' (count all threads), 'all_unread' (count all unread threads). Boolean fields: has_trashed, has_draft, has_starred, has_attachments, has_archived, has_sender, has_active, has_delivery_pending, has_delivery_failed, is_spam, has_messages, has_unread_mention, has_mention, has_assigned_to_me, has_unassigned. Unread variants ('_unread' suffix): count threads where the condition is true AND the thread is unread. Examples: 'all,all_unread', 'has_starred,has_starred_unread', 'is_spam,is_spam_unread'

Response

A dictionary containing the aggregated counts. Keys correspond to the fields requested via the stats_fields query parameter. Each value is an integer count. Keys not requested will not be present in the response.

object required