Tag many threads

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 /local-emails/{caseId}/threads/tags

Adds tags to threads chosen by id, or to every thread matching a search, optionally tagging each thread's emails too. By search, a background job is queued and its id returned.

Path parameters

  • caseId string Required
application/json

Body Required

  • addMode string Required

    Values are by_id or by_search.

  • tags array[string] Required

    Tag ids or names to ADD (additive union).

    At least 1 but not more than 100 elements.

  • ids array[string]

    Not more than 500 elements.

  • autoTagEmails boolean

    When true, additively tag every email of the affected thread(s).

    Default value is false.

Responses

  • 200 application/json
    Hide response attributes Show response attributes object
    • data object Required
      Hide data attributes Show data attributes object
      • mode string Required

        Values are by_id or by_search.

      • status string Required

        'completed' for by_id; 'queued' for by_search.

      • requested number
      • matchedDocuments number
      • skippedDocuments number
      • resolvedTagIds array[string]
      • attachmentsCreated number
      • emailsMatched number

        by_id threads + autoTagEmails

      • emailAttachmentsCreated number

        by_id threads + autoTagEmails

      • jobId string

        by_search job id

    • statusCode number Required
    • timestamp string(date-time) Required
POST /local-emails/{caseId}/threads/tags
curl \
 --request POST 'http://api.example.com/local-emails/{caseId}/threads/tags' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{
  "addMode": "by_id",
  "tags": [
    "string"
  ],
  "ids": [
    "string"
  ],
  "search": {
    "page": 1,
    "perPage": 10,
    "skip": 42.0,
    "limit": 42.0,
    "sortOrder": "asc",
    "folders": [
      "string"
    ],
    "domains": [
      "string"
    ],
    "excludeDomains": [
      "string"
    ],
    "tags": [
      "string"
    ],
    "excludeTags": [
      "string"
    ],
    "participants": [
      "string"
    ],
    "excludeEmails": [
      "string"
    ],
    "starred": true,
    "unread": true,
    "untagged": true,
    "startDate": "2024-01-01T00:00:00.000Z",
    "endDate": "2024-12-31T23:59:59.999Z",
    "sourceEmails": [
      "string"
    ],
    "sortBy": "latestMessageReceivedDate",
    "includeLastMessage": true,
    "includeHidden": false,
    "sharedStatus": "shared"
  },
  "autoTagEmails": false
}'
Request examples
{
  "addMode": "by_id",
  "tags": [
    "string"
  ],
  "ids": [
    "string"
  ],
  "search": {
    "page": 1,
    "perPage": 10,
    "skip": 42.0,
    "limit": 42.0,
    "sortOrder": "asc",
    "folders": [
      "string"
    ],
    "domains": [
      "string"
    ],
    "excludeDomains": [
      "string"
    ],
    "tags": [
      "string"
    ],
    "excludeTags": [
      "string"
    ],
    "participants": [
      "string"
    ],
    "excludeEmails": [
      "string"
    ],
    "starred": true,
    "unread": true,
    "untagged": true,
    "startDate": "2024-01-01T00:00:00.000Z",
    "endDate": "2024-12-31T23:59:59.999Z",
    "sourceEmails": [
      "string"
    ],
    "sortBy": "latestMessageReceivedDate",
    "includeLastMessage": true,
    "includeHidden": false,
    "sharedStatus": "shared"
  },
  "autoTagEmails": false
}
Response examples (200)
{
  "data": {
    "mode": "by_id",
    "status": "completed",
    "requested": 2,
    "matchedDocuments": 2,
    "skippedDocuments": 0,
    "resolvedTagIds": [
      "65a1b2c3d4e5f6a7b8c9d0a1"
    ],
    "attachmentsCreated": 2,
    "emailsMatched": 0,
    "emailAttachmentsCreated": 0,
    "jobId": "65a1b2c3d4e5f6a7b8c9d0f2"
  },
  "statusCode": 200,
  "timestamp": "2026-01-15T10:15:00.000Z"
}