Set tags on an AI chat conversation

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
PATCH /ai-chat/{caseId}/profile/{providerId}/conversation/{conversationId}/tags

Replaces an AI chat conversation's tags with the given list of tag ids or names; names that do not exist yet are created as case tags. Returns the updated conversation, where attachedTags leave out tags the other side added by hand.

Path parameters

  • caseId string Required
  • providerId string Required
  • conversationId string Required
application/json

Body Required

  • tags array[string] Required

    Array of tag names or tag IDs to apply

Responses

  • 200 application/json
    Hide response attributes Show response attributes object
    • data object Required
      Hide data attributes Show data attributes object
      • createdAt string(date-time) Required
      • updatedAt string(date-time) Required
      • id string Required
      • aiChatProvider string Required
      • externalId string Required
      • title string | null Required
      • createdDate string(date-time) | null Required
      • updatedDate string(date-time) | null Required
      • model string | null Required
      • projectId string | null Required
      • projectName string | null Required
      • systemPrompt string | null Required
      • isShared boolean Required

        Not filled by any importer today, so always false.

      • messagesCount number Required
      • firstMessageDate string(date-time) | null Required
      • lastMessageDate string(date-time) | null Required
      • lastMessageText string | null Required
      • totalInputTokens number Required

        Not filled by any importer today, so always 0.

      • totalOutputTokens number Required

        Not filled by any importer today, so always 0.

      • tags array[object]

        Tags on the conversation, each with its name (legacy; attachedTags is the side-aware list).

        Hide tags attributes Show tags attributes object
        • _id string
        • name string
      • commentsCount number
      • comments array[object]

        Comment references on the conversation

      • attachedTags array[object]
        Hide attachedTags attributes Show attachedTags attributes object
        • tagId string Required

          Tag id (Tag._id)

        • tag string Required

          Tag display name (Tag.name)

        • addedBy string Required

          Values are user, ai, auto, auto-import, system, or default.

        • addedById string | null
        • removedAt string(date-time) | null
        • removedBy string | null

          Values are user, ai, auto, auto-import, system, or default.

        • removedById string | null
    • statusCode number Required
    • timestamp string(date-time) Required
PATCH /ai-chat/{caseId}/profile/{providerId}/conversation/{conversationId}/tags
curl \
 --request PATCH 'http://api.example.com/ai-chat/{caseId}/profile/{providerId}/conversation/{conversationId}/tags' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{
  "tags": [
    "string"
  ]
}'
Request examples
{
  "tags": [
    "string"
  ]
}
Response examples (200)
{
  "data": {
    "createdAt": "2026-01-15T14:30:00.000Z",
    "updatedAt": "2026-01-15T14:30:00.000Z",
    "id": "507f1f77bcf86cd799439011",
    "aiChatProvider": "65a1b2c3d4e5f6a7b8c9d0e2",
    "externalId": "conv_01HZX3K9P7",
    "title": "Lease review",
    "createdDate": "2026-01-15T14:28:00.000Z",
    "updatedDate": "2026-01-15T14:41:00.000Z",
    "model": "gpt-4o",
    "projectId": "0f8e2c1a-6b7d-4e3f-9a1b-2c3d4e5f6a7b",
    "projectName": "Contract reviews",
    "systemPrompt": "You are a helpful assistant.",
    "isShared": false,
    "messagesCount": 12,
    "firstMessageDate": "2026-01-15T14:28:00.000Z",
    "lastMessageDate": "2026-01-15T14:41:00.000Z",
    "lastMessageText": "Here is a plain-English summary of clause 4.",
    "totalInputTokens": 0,
    "totalOutputTokens": 0,
    "tags": [
      {
        "_id": "65a1b2c3d4e5f6a7b8c9d0a1",
        "name": "Responsive"
      }
    ],
    "commentsCount": 2,
    "comments": [
      {
        "_id": "65a1b2c3d4e5f6a7b8c9d0e3",
        "case": "507f1f77bcf86cd799439011",
        "comment": "65a1b2c3d4e5f6a7b8c9d0e2"
      }
    ],
    "attachedTags": [
      {
        "tagId": "507f1f77bcf86cd799439011",
        "tag": "Important",
        "addedBy": "user",
        "addedById": "507f1f77bcf86cd799439012",
        "removedAt": "2026-05-04T09:42:00Z",
        "removedBy": "user",
        "removedById": "string"
      }
    ]
  },
  "statusCode": 200,
  "timestamp": "2026-01-15T10:15:00.000Z"
}