The comment search API lets you find, filter, and analyze comments or notes attached to tickets or other entities using flexible Typesense-powered queries. You can search by text, filter by any comment property, and select exactly which fields you want in the response.

Example use cases

  • Get all comments for a specific ticket

    {
      "query_by": "content",
      "filter_by": "ticket_id:=TICKET123",
      "q": "*"
    }
  • Find comments created by a specific user

    {
      "query_by": "content",
      "filter_by": "created_by_email:=user@company.com",
      "q": "*"
    }
  • List all pinned comments in the last 7 days

    {
      "query_by": "content",
      "filter_by": "is_pinned:=true&&created_at:>2024-05-01",
      "q": "*"
    }
  • Get comments containing the word ‘urgent’

    {
      "query_by": "content",
      "q": "urgent"
    }
  • Find edited comments for a specific team

    {
      "query_by": "content",
      "filter_by": "team_uid:=T88S900BHN&&is_edited:=true",
      "q": "*"
    }

Comment search response fields

Below are all the fields you may see in a comment search result. Many are optional and will only appear if included in your include_fields parameter.

FieldTypeDescription
ticket_idstringTicket ID the comment belongs to
contentstringComment content
created_atstringCreation timestamp (ISO8601)
updated_atstringLast update timestamp (ISO8601)
created_by_idstringCreator’s user ID
created_by_emailstringCreator’s email
created_by_namestringCreator’s name
team_uidstringTeam UID
team_identifierstringTeam identifier
ticket_ticket_idstringTicket’s ticket ID
comment_typestringType of comment
comment_visibilitystringComment visibility
is_editedbooleanWhether the comment was edited
is_pinnedbooleanWhether the comment is pinned
content_markdownstringMarkdown content
content_htmlstringHTML content
organization_idstringOrganization ID
ticket_identifierstringTicket identifier
ticket_uidstringTicket UID
organization_uidstringOrganization UID

For a full list, see the CommentSearchResponseDto in the API reference.


Tip: Use the include_fields parameter to limit the response to only the fields you need for performance and clarity.

Notes

  • The document in each hit will match the schema for the selected collection (Ticket, Account, or Comment).
  • Field names in query parameters can be provided in camelCase and will be mapped to the correct Typesense field names automatically.
  • Filtering and sorting support all Typesense operators and syntax.
  • Only authorized users can access this endpoint; results are scoped to the user’s organization and teams.

For more details on available fields and advanced search options, refer to the Typesense documentation or your collection’s schema.