Count emails per tag

Add MCP server to your AI tool

Allow AI tools and LLMs to interact with the API documentation portal through MCP.

MCP server URL

https://docs.usehearsay.com/mcp

Standard setup for AI tools providing an mcp.json file

mcp.json
{
  "integrations MCP server": {
    "url": "https://docs.usehearsay.com/mcp"
  }
}

Close
GET /local-emails/{caseId}/tags-count

Returns how many emails in the case carry each tag, for the given filters. On a case shared with opposing counsel, each side counts only its own tags.

Path parameters

  • caseId string Required

Query parameters

  • page number

    Default value is 1.

  • perPage number

    Default value is 10.

  • skip number

    If skip/limit not provided, page/perPage will take precedence

  • limit number

    If skip/limit not provided, page/perPage will take precedence

  • sortOrder string

    Values are asc or desc. Default value is asc.

  • sourceEmail string Required

    Source mailbox email to scope the counts to (the provider email).

  • tagOrigin string

    Filter tags by how they were created; omit for all origins.

    Values are manual or auto-import.

  • sortBy string

    Sort by email count or alphabetically by tag name. Default order is desc for count and asc for name; override with sortOrder.

    Values are count or name. Default value is count.

  • searchText string

    Case-insensitive substring match on tag name.

Responses

  • 200 application/json
    Hide response attributes Show response attributes object
    • data object Required
      Hide data attributes Show data attributes object
      • total number Required
      • page number
      • perPage number
      • skip number
      • limit number
      • totalPages number Required
      • nextPage number | null Required
      • previousPage number | null Required
      • data array[object] Required
        Hide data attributes Show data attributes object
        • tag string Required

          Tag name.

        • count number Required

          Number of emails carrying this tag.

    • statusCode number Required
    • timestamp string(date-time) Required
GET /local-emails/{caseId}/tags-count
curl \
 --request GET 'http://api.example.com/local-emails/{caseId}/tags-count?sourceEmail=string' \
 --header "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
{
  "data": {
    "total": 42,
    "page": 1,
    "perPage": 20,
    "skip": 0,
    "limit": 20,
    "totalPages": 3,
    "nextPage": 2,
    "previousPage": 42.0,
    "data": [
      {
        "tag": "Responsive",
        "count": 64
      }
    ]
  },
  "statusCode": 200,
  "timestamp": "2026-01-15T10:15:00.000Z"
}