Count messages 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
POST /conversation/{caseId}/tags-count

Returns how many messages in the case carry each tag, for the given filters.

Headers

  • organization string Required

    id of the selected (active) organization

Path parameters

  • caseId string Required
application/json

Body

  • 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

  • conversationIds array[string]

    Restrict to these conversation ids (must belong to the case). Omit to cover every conversation in the case.

    Not more than 500 elements.

  • devices array[string]

    Restrict to conversations on these device ids.

    Not more than 50 elements.

  • sources array[string]

    Restrict to conversations of these sources.

    Not more than 8 elements. Values are message, whatsapp, voicemail, call_log, facebook_dump, instagram_dump, threads_dump, or email.

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 messages carrying this tag.

    • statusCode number Required
    • timestamp string(date-time) Required
POST /conversation/{caseId}/tags-count
curl \
 --request POST 'http://api.example.com/conversation/{caseId}/tags-count' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --header "organization: string" \
 --data '{
  "page": 1,
  "perPage": 10,
  "skip": 42.0,
  "limit": 42.0,
  "conversationIds": [
    "string"
  ],
  "devices": [
    "string"
  ],
  "sources": [
    "message"
  ]
}'
Request examples
# Headers
organization: string

# Payload
{
  "page": 1,
  "perPage": 10,
  "skip": 42.0,
  "limit": 42.0,
  "conversationIds": [
    "string"
  ],
  "devices": [
    "string"
  ],
  "sources": [
    "message"
  ]
}
Response examples (200)
{
  "data": {
    "total": 42,
    "page": 1,
    "perPage": 20,
    "skip": 0,
    "limit": 20,
    "totalPages": 3,
    "nextPage": 2,
    "previousPage": 42.0,
    "data": [
      {
        "tag": "Important",
        "count": 12
      }
    ]
  },
  "statusCode": 200,
  "timestamp": "2026-01-15T10:15:00.000Z"
}