Show more

Use to navigate results, ENTER to select one, ESC to close

Type in any word to easily find the endpoint, property or group of operations you are looking for.

API changelog
Download source
  • JSON OpenAPI specification
  • YAML OpenAPI specification
integrations

Topics

  • Introduction
  • Authentication

Endpoints

  • auth
    • Sign in with email and password POST
    • Create a long-lived API token POST
    • List my automation tokens GET
    • Revoke an automation token DELETE
    • Change an automation token's scopes PATCH
    • Refresh the access token POST
    • Sign out POST
    • Sign up a new user and organization POST
    • Email a password-reset link POST
    • Reset the password with an emailed token POST
    • Check whether an email can sign up POST
  • billing
    • Upgrade a case to Pro POST
    • Start adding a card POST
    • Choose or change the plan POST
    • Get a case's billing statement GET
    • Get the organization's charges by case GET
    • List billing events (internal) GET
    • List self-serve plans GET
    • Get the current plan and usage GET
    • Get the credit balance GET
    • Get the billing report (internal) POST
  • user
    • Get my profile GET
    • Update my profile PATCH
    • Change my password POST
    • Verify an email address POST
    • Resend the verification email (internal) POST
  • organizations
    • Create an organization POST
    • List organization invitations GET
    • Check whether an organization name is free (internal) POST
    • List my pending organization invitations (internal) GET
    • Get an organization GET
    • Update an organization PATCH
    • Get an organization by slug (internal) GET
    • Get an organization's plan usage (internal) GET
    • Get an organization's storage by case GET
    • List my organizations GET
    • List organization members GET
    • Invite users to an organization POST
    • Delete a pending invitation DELETE
    • Resend an invitation POST
    • Accept an organization invitation POST
    • Reject an organization invitation (internal) POST
    • Change members' organization roles (internal) PATCH
    • Update organization members PATCH
    • Remove a member from an organization DELETE
    • Ask the organization for more devices (internal) POST
    • List organization tags GET
    • Create an organization tag POST
    • Delete an organization tag DELETE
    • Update an organization tag PATCH
  • cases
    • List cases GET
    • Create a case POST
    • Check whether a case name is free GET
    • Get a case GET
    • Update a case PATCH
    • List a case's data sources GET
    • Get a case by slug GET
    • Archive a case POST
    • Unarchive a case POST
    • Remove all conversations from a case DELETE
    • Link conversations to a case PATCH
    • Unlink conversations from a case PATCH
    • List case exports GET
    • Start a case export POST
    • Delete an export DELETE
    • Re-run an export POST
    • List a case's extraction codes GET
    • Create an extraction code POST
    • Get data-collection status (v1) GET
    • Get data-collection status (v2) GET
    • Get data-collection status as a tree GET
    • Get data-collection status (tree v3) GET
    • Delete an extraction code DELETE
    • Update an extraction code PATCH
    • Update a custodian's contact details PATCH
    • Email an extraction code POST
    • List conversation searches GET
    • List device activity GET
    • Request a zip of conversation attachments POST
    • List a case's tags GET
    • Create a tag POST
    • Delete a tag DELETE
    • Update a tag PATCH
  • case-access
    • Search case invitations across organizations GET
    • List my pending case invitations GET
    • List case members GET
    • List case invitations GET
    • Add every organization member to a case POST
    • Invite people to a case POST
    • Cancel a pending invitation DELETE
    • Resend an invitation POST
    • Accept a case invitation POST
    • Reject a case invitation POST
    • Change a member's case access PATCH
    • Remove a member from a case DELETE
    • Invite a colleague (opposing counsel) POST
    • Remove a colleague (opposing counsel) DELETE
    • Cancel a colleague invitation (opposing counsel) DELETE
  • collections
    • List a case's collections GET
    • Create a collection POST
    • Create collections from search terms POST
    • List a collection's entries GET
    • Get a collection GET
    • Delete a collection DELETE
    • Rename a collection PATCH
    • Get a collection by slug GET
    • Add messages to a collection PATCH
    • Add whole conversations to a collection PATCH
    • Remove messages from a collection PATCH
    • Empty a collection PATCH
    • Insert an entry at a position POST
    • Move an entry PATCH
  • case-contact
    • List a case's contacts GET
    • Edit a contact PATCH
    • Link two contacts PATCH
    • Export contacts to CSV POST
    • Archive conversations POST
    • Unarchive conversations POST
    • Edit a conversation PATCH
    • Set a conversation's tags PATCH
    • Add a conversation manually POST
  • case-browser-history
    • List browser history GET
  • cases/files
    • List case files GET
    • Add files to a case POST
    • Request a zip of case files POST
    • Set a file's category PATCH
    • Set a file's tags PATCH
  • cases/media
    • List case media GET
  • cases/notes
    • List case notes GET
  • cases/extraction-code/suggestions
    • List suggestions for an extraction code GET
    • Suggest an extraction-code configuration POST
    • Withdraw my open suggestion DELETE
    • Edit my open suggestion PATCH
    • Comment on a suggestion POST
    • Approve a suggestion PATCH
    • Reject a suggestion PATCH
  • cases/extraction-code/review
    • Approve an extraction code PATCH
    • Reject an extraction code PATCH
  • cases/oc-approvals
    • Approve data for the other side POST
    • Withdraw data approval POST
    • List data approvals GET
  • extraction
    • Record collection events (internal) POST
    • Save device file hashes (internal) POST
    • Match device file hashes (internal) POST
    • Upload app logs without a session (internal) POST
    • Upload app logs (internal) POST
    • Upload app logs from S3 without a session (internal) POST
    • Upload app logs from S3 (internal) POST
    • Get the backup status of devices (internal) POST
    • Sign out POST
    • Refresh the access token (internal) POST
    • Sign in with an extraction code POST
    • Get temporary S3 upload credentials (internal) POST
    • Import uploaded conversations (internal) POST
    • List uploaded conversations (internal) GET
    • Record device activity (internal) POST
    • Report a device backup update (internal) POST
    • Report device storage usage (internal) POST
    • Record user-reported device storage (internal) POST
    • Register or update a device (internal) POST
    • Get the signed-in user's profile GET
    • Update the signed-in user's profile PATCH
    • Update extraction code metadata PATCH
    • Get the organization's plan usage (internal) GET
    • Ask the organization's admins for more devices (internal) POST
    • Post device messages to Slack (internal) POST
    • Post tracking messages to Slack (internal) POST
    • Post a conversation upload status to Slack (internal) POST
    • Register an uploaded debug bundle (internal) POST
    • Get desktop app settings (internal) GET
    • Add uploaded files to the case POST
    • Import device media records (internal) POST
    • Import device notes (internal) POST
    • Import Safari browser history (internal) POST
    • Import call logs (internal) POST
    • Count imported files (internal) GET
    • List files uploaded with the extraction code GET
    • List the extraction code's mailboxes GET
    • List a mailbox's folders POST
    • List email threads GET
    • List the emails in a thread GET
    • Search emails GET
    • List sender and recipient domains GET
    • Get the thread of an email GET
    • Get the collection status tree GET
    • Get the collection status (v2) GET
    • Create a Plaid Link token POST
    • Connect a bank account through Plaid POST
    • Import an AI chat export POST
    • Import a LinkedIn export (internal) POST
    • Register an uploaded file POST
  • admin
    • List the collection queue (internal) GET
    • Count in-flight collections by stage (internal) GET
    • List running backups and uploads (internal) GET
    • List inbox cards (internal) GET
    • Clear one inbox item (internal) POST
    • Clear all inbox items of a code (internal) POST
    • Snooze an inbox item (internal) POST
    • Wake a snoozed inbox item (internal) POST
    • Get one collection's detail (internal) GET
    • List a collection's event timeline (internal) GET
    • Get a download link for an event attachment (internal) GET
    • Ask the custodian's computers for logs (internal) POST
    • Watch or unwatch a collection (internal) PATCH
    • Mark an organization as priority (internal) PATCH
    • Get collection funnel and lifecycle stats (internal) GET
    • Get stats for one error code (internal) GET
    • Get a collection timeline as markdown (internal) GET
    • Create a read-only link to a collection timeline (internal) POST
    • Search all cases (internal) GET
    • List a case's event log (internal) GET
    • Create a case for a user (internal) POST
    • Delete a case's conversations (internal) DELETE
    • Create extraction codes for cases (internal) POST
    • Update an extraction code (internal) POST
    • List extraction codes (internal) GET
    • Create extraction codes for all cases (internal) POST
    • Re-run an export (internal) POST
    • Re-run several exports as a batch (internal) POST
    • Get a re-run batch (internal) GET
    • Clear all export locks (internal) POST
    • Count a case's messages (internal) GET
    • Move a case to another organization (internal) POST
    • Move a device to another case (internal) POST
    • Delete a Discord profile (internal) DELETE
    • Delete a Reddit profile (internal) DELETE
    • Search organizations (internal) GET
    • List organizations with their members (internal) GET
    • Get an organization by slug (internal) GET
    • Get an organization by id (internal) GET
    • Get storage use per organization (internal) GET
    • Give every member access to every case (internal) POST
    • Give one member access to every active case (internal) POST
    • Add a user to an organization (internal) POST
    • Remove a user from an organization (internal) POST
    • Transfer organization ownership (internal) PATCH
    • Update an organization (internal) PATCH
    • Clear the whole cache (internal) POST
    • List cache keys (internal) GET
    • Get a cache value (internal) GET
    • Set a cache value (internal) POST
    • Delete a cache key (internal) DELETE
    • Search users (internal) GET
    • Create a user (internal) POST
    • Set a user's password (internal) POST
    • Send a password-reset email (internal) POST
    • Log in as a user (internal) POST
    • Delete a user account (internal) POST
    • Change a user's email (internal) POST
    • Lock a user (internal) POST
    • Unlock a user (internal) POST
    • Count device uploads (internal) POST
    • Get platform totals (internal) GET
    • List newly extracted devices (internal) POST
    • Get the organization activity report (internal) GET
    • Get yesterday's extraction report (internal) GET
    • Send yesterday's extraction report (internal) GET
    • List extraction statuses (internal) GET
    • List connected email accounts (internal) POST
    • List phone storage logs (internal) GET
    • List notifications (internal) GET
    • Sync an organization's legacy subscription (internal) POST
    • Change an organization's legacy plan (internal) POST
    • Start a tag migration (internal) POST
    • Get a tag migration job (internal) GET
    • Cancel a tag migration job (internal) POST
    • Delete a mailbox's imported emails from a case (internal) DELETE
    • Backfill tag mailboxes (internal) POST
    • Fix keyword tags on search imports (internal) POST
    • Delete uploaded case files (internal) POST
    • Update an organization's billing profile (internal) PATCH
    • Move an organization to case billing (internal) POST
    • Add a billing item to a case (internal) POST
    • Give a case a free pro upgrade (internal) POST
    • Comp a billing item (internal) POST
    • Void a billing item (internal) POST
    • Grant AI tokens to a case (internal) POST
    • Change an organization's plan (internal) POST
    • Get an organization's plan and usage (internal) GET
    • Get an organization's billing statement (internal) GET
    • Get an organization's credit balance (internal) GET
    • Grant credit to an organization (internal) POST
    • Get an organization's prepaid units (internal) GET
    • Waive prepaid units for an organization (internal) POST
    • List daily billing sweep runs (internal) GET
    • Run the daily billing sweep now (internal) POST
    • Run the monthly AI overage close now (internal) POST
    • Run the monthly storage check now (internal) POST
    • Run billing reconciliation now (internal) POST
    • List coupons (internal) GET
    • Create a coupon (internal) POST
    • Get a coupon (internal) GET
    • Delete a coupon (internal) DELETE
    • Apply a coupon to an organization (internal) POST
    • Remove the active coupon (internal) DELETE
    • Remove a coupon from the stack (internal) DELETE
    • Get an organization's coupon stack (internal) GET
    • List draft billing items (internal) GET
    • Park a billing item as a draft (internal) POST
    • Release a draft billing item (internal) POST
    • Build a billing report across organizations (internal) POST
    • Get a queued billing report (internal) GET
    • List recurring add-ons (internal) GET
    • Start a recurring add-on (internal) POST
    • Cancel a recurring add-on (internal) DELETE
    • List feature flags (internal) GET
    • Turn a feature flag on or off (internal) PATCH
    • List live exports (internal) GET
    • Cancel an export (internal) POST
    • Resume an export (internal) POST
    • Move a queued export in the queue (internal) POST
    • Remove a queued export's job (internal) DELETE
  • public
    • Read a collection timeline from a shared link (internal) GET
  • certificates
    • List the certificates of a case GET
    • Store a certificate POST
    • Verify a certificate file POST
    • Verify a certificate by id GET
    • Get the certificate PDF link GET
    • Get the certificate JSON link GET
    • Revoke a certificate PATCH
  • conversation
    • Bulk-import conversations (internal) POST
    • List conversations GET
    • List messages in a conversation GET
    • Compare conversations side by side POST
    • Search message text GET
    • Advanced message search POST
    • Count messages per tag POST
    • List uploaded conversations (internal) GET
    • Find the message nearest a date GET
    • Tag many messages POST
    • Tag a message POST
    • Untag a message DELETE
  • aws
    • Get temporary S3 upload credentials POST
  • common
    • Register an uploaded S3 object as a file (internal) POST
    • Get a signed download URL for a file GET
    • Download the Apple Mobile Device Support installer (internal) GET
    • Download a file GET
    • Download a file's original, with a file name in the URL GET
    • Download a file's browser-displayable version GET
    • Download a file, with a file name in the URL GET
  • application
    • Get the latest desktop app downloads GET
    • Refresh the cached desktop app links (internal) GET
    • Refresh the Android app download (internal) GET
  • devices
    • Record device file hashes (internal) POST
    • Check a device file hash (internal) POST
    • Get a device GET
    • Update a device PATCH
  • device-activity-log
    • Record device activity (internal) POST
  • comments
    • List a message's comments (legacy) GET
    • Comment on a message (legacy) POST
    • List a case's comments GET
    • Reply to a comment (legacy) POST
    • Delete a comment (legacy) DELETE
    • Edit a comment (legacy) PATCH
    • List an item's comments GET
    • Comment on an item POST
    • Delete a comment DELETE
    • Edit a comment PATCH
    • Reply to a comment POST
  • dashboard
    • List my alerts (internal) GET
    • List my updates (internal) GET
    • Mark a notification as read (internal) PATCH
    • Mark all notifications as read (internal) PATCH
  • StripeWebhook
    • Stripe invoice and charge events (internal) POST
    • Stripe subscription events (internal) POST
  • payments
    • List legacy subscription plans (internal) GET
    • Check a coupon code (internal) POST
    • Start a legacy subscription checkout (internal) POST
    • Change the legacy subscription plan (internal) POST
    • Create a legacy pricing-table session (internal) POST
    • Open the Stripe billing portal (internal) POST
  • app-config
    • Get the desktop app config (internal) GET
    • Create or update the desktop app config (internal) POST
    • Save a device's settings (internal) POST
    • Delete a device's settings (internal) POST
  • integrations
    • Create a case for a partner POST
  • legal
    • List Clio matters GET
    • Link a case to a Clio matter POST
    • Unlink a case from a Clio matter DELETE
    • List Smokeball matters GET
    • Link a case to a Smokeball matter POST
    • Unlink a case from a Smokeball matter DELETE
    • List the matter participants of a case GET
    • Get the sync settings of a destination GET
    • Update the sync settings of a destination PATCH
    • Export case data to a provider POST
    • List the legal sync records of a case GET
    • Create a Clio expense entry (internal) POST
    • Create a Smokeball expense entry (internal) POST
    • Start a Clio connection GET
    • Finish a Clio connection (internal) GET
    • Disconnect Clio for the organization DELETE
    • Disconnect my Clio connection DELETE
    • Start a Smokeball connection GET
    • Finish a Smokeball connection (internal) GET
    • Disconnect Smokeball for the organization DELETE
    • Disconnect my Smokeball connection DELETE
    • Start a Dropbox connection GET
    • Finish a Dropbox connection (internal) GET
    • Get the Dropbox connection status GET
    • Disconnect Dropbox DELETE
    • List Dropbox folders GET
    • Get the Dropbox folder of a case GET
    • Set the Dropbox folder of a case PUT
    • Clear the Dropbox folder of a case DELETE
    • Receive Clio matter events (internal) POST
    • Receive Clio document events (internal) POST
    • Receive a Clio deauthorization (internal) POST
    • Receive Smokeball events (internal) POST
    • List legal provider connections GET
  • clients
    • List connected desktop apps (internal) GET
    • Ask a desktop app for its logs (internal) POST
    • Open a support conversation in the desktop app (internal) POST
  • email-data
    • Start linking a mailbox (internal) POST
    • Link an OAuth mailbox (internal) POST
    • Link an IMAP mailbox (internal) POST
    • Search a linked mailbox's emails (internal) POST
    • List a linked mailbox's folders (internal) POST
    • Search a linked mailbox's threads (internal) POST
    • Search an IMAP mailbox's threads (internal) POST
    • Start an email import POST
    • Resume a failed import job (internal) POST
    • Cancel an import job POST
    • List email import jobs GET
    • Get an email import job GET
    • List linked mailboxes (internal) GET
  • local-emails
    • List email threads GET
    • Delete email threads DELETE
    • List the emails in a thread GET
    • Search emails GET
    • Count emails per tag GET
    • Count matches for several searches POST
    • List sender and recipient domains GET
    • List addresses in a domain GET
    • Get the thread of an email GET
    • Tag many emails POST
    • Tag many threads POST
    • Hide or unhide threads POST
    • List bulk-tag jobs GET
    • Get a bulk-tag job GET
    • Set an email's tags PATCH
    • Set a thread's tags PATCH
  • discord
    • List Discord profiles GET
    • Archive a Discord profile DELETE
    • Get a Discord profile GET
    • List Discord conversations GET
    • List Discord messages GET
    • List Discord import jobs GET
    • Start a Discord import (internal) POST
    • Get a Discord import job GET
    • List Discord activity events GET
    • List Discord support tickets GET
  • reddit
    • List Reddit profiles GET
    • Archive a Reddit profile DELETE
    • Get a Reddit profile GET
    • List Reddit posts GET
    • List Reddit comments GET
    • List Reddit private messages GET
    • List Reddit chat messages GET
    • List Reddit votes GET
    • List Reddit import jobs GET
    • Start a Reddit import (internal) POST
    • Get a Reddit import job GET
  • linkedin
    • List LinkedIn profiles GET
    • List LinkedIn import jobs GET
    • Get LinkedIn import coverage for a file (internal) GET
    • Get a LinkedIn import job GET
    • Start a LinkedIn import (internal) POST
    • Request a LinkedIn PDF export POST
    • List LinkedIn exports GET
    • Get a LinkedIn export GET
    • Search LinkedIn messages in a case GET
    • Get a LinkedIn profile GET
    • Archive or delete a LinkedIn profile DELETE
    • List LinkedIn conversations GET
    • Get a LinkedIn conversation GET
    • List LinkedIn messages GET
    • List LinkedIn connections GET
    • List LinkedIn comments GET
    • List LinkedIn rich media GET
    • List LinkedIn saved jobs GET
    • List LinkedIn saved items GET
    • List LinkedIn job applications GET
    • List LinkedIn saved job alerts GET
    • Toggle a tag on a LinkedIn conversation PATCH
    • Toggle a tag on a LinkedIn connection PATCH
  • ai-chat
    • List AI chat profiles GET
    • Archive an AI chat profile DELETE
    • Search AI chat messages in a case GET
    • Get an AI chat profile GET
    • List AI chat conversations GET
    • List AI chat messages GET
    • Export an AI chat conversation to PDF POST
    • List AI chat import jobs GET
    • Start an AI chat import (internal) POST
    • Get an AI chat import job (internal) GET
    • Set tags on an AI chat conversation PATCH
  • ai-admin
    • Smoke-test Bedrock embeddings (internal) POST
    • Smoke-test Bedrock Claude (internal) POST
    • Smoke-test Bedrock rerank (internal) POST
    • Backfill AI ingestion for device messages (internal) POST
    • Backfill AI ingestion for LinkedIn (internal) POST
    • Backfill AI ingestion for Discord (internal) POST
    • Backfill AI ingestion for email (internal) POST
    • Backfill AI ingestion for AI chat (internal) POST
    • Backfill AI ingestion for Reddit (internal) POST
    • List the active AI prompts (internal) GET
    • List the versions of an AI prompt (internal) GET
    • Get the active AI prompt (internal) GET
    • Get one AI prompt version (internal) GET
    • Edit an AI prompt version in place (internal) PATCH
    • Create an AI prompt draft (internal) POST
    • Activate an AI prompt version (internal) POST
    • Reset an AI prompt to its code default (internal) POST
  • ai
    • Cancel the AI jobs of a case POST
    • Reset the AI data of a case POST
    • Search case evidence POST
    • Get the AI processing progress GET
    • Get the AI case summary GET
    • Regenerate the case narrative POST
    • Accept the pending narrative POST
    • Discard the pending narrative DELETE
    • Update the attorney notes PUT
    • Get the AI case context GET
    • Update the AI case context PATCH
    • Confirm the AI case context POST
    • Extract case context from a filing POST
    • List filing extractions GET
    • Apply a filing extraction POST
    • Get the evidentiary map GET
    • Regenerate the evidentiary map POST
    • Regenerate one evidentiary map element POST
    • Set an attorney override on an element PUT
    • Suggest tags for a conversation chunk POST
  • financial-data
    • Create a Plaid sandbox public token (internal) POST
    • List investment transactions GET
    • Get a Plaid item's live status GET
    • Disconnect a Plaid item DELETE
    • List financial accounts GET
    • List investment holdings GET
    • List liabilities GET
    • Re-run Plaid syncs for an item (internal) POST
    • List transactions GET
    • Summarize an account's transactions by category GET
    • Summarize a case's transactions by month and category GET
    • Download the monthly category summary as CSV GET
    • List a case's transaction categories GET
    • Change a transaction's category PATCH
    • List recurring transactions GET
    • Tag a transaction POST
    • Remove tags from a transaction DELETE
    • Tag several transactions POST
    • Tag a recurring transaction POST
    • Remove tags from a recurring transaction DELETE
    • Tag several recurring transactions POST
    • Tag a liability POST
    • Remove tags from a liability DELETE
    • Tag several liabilities POST
    • Tag a holding POST
    • Remove tags from a holding DELETE
    • Tag several holdings POST
    • Tag an investment transaction POST
    • Remove tags from an investment transaction DELETE
    • Tag several investment transactions POST
    • List a Plaid item's bank statements GET
    • Download all statements as a ZIP POST
    • Refresh a Plaid item's statements POST
  • financial-data-export
    • Export an account's transactions POST
    • Export a Plaid item's transactions POST
    • Export an account's recurring transactions POST
    • Export a Plaid item's recurring transactions POST
    • Export an account's holdings POST
    • Export a Plaid item's holdings POST
    • Export an account's liabilities POST
    • Export a Plaid item's liabilities POST
    • Export an account's investment transactions POST
    • Export a Plaid item's investment transactions POST
    • List a case's financial exports GET
    • Get a financial export's status GET
  • plaid-partner
    • Register the organization with Plaid POST
    • Remove the organization from Plaid DELETE
    • Get the organization's Plaid status GET
    • List OAuth bank registrations GET
    • Receive a Plaid partner webhook (internal) POST
  • WellKnown
    • Microsoft identity association (internal) GET
  • data-source
    • List data sources GET
  • app
    • Health check (internal) GET
  • case-events
    • List case events GET
Powered by Bump.sh
API changelog
Download source
  • JSON OpenAPI specification
  • YAML OpenAPI specification
integrations

Search case evidence

Ask AI
  • Add to Cursor
  • Add to VSCode
  • Add to other AI tools (MCP)

  • Open in ChatGPT
  • Open in Claude

  • View as Markdown
  • Copy as Markdown

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 /ai/cases/{caseId}/search
Access token

Runs a semantic search over the case evidence and returns the best matches (messages or conversation chunks) with score, snippet and, when asked, the surrounding messages, filtered by source, dates, participants, conversations, topics or relevance. On a case shared with opposing counsel, callers on the other side see only evidence released to them, and conversation chunks are left out. Requires commenter access or above to the case and an active plan (403 otherwise).

Path parameters

  • caseId string Required

    Id of the case

application/json

Body Required

  • query string Required
  • filters object
    Hide filters attributes Show filters attributes object
    • sources array[string]

      Values are device_message, linkedin, reddit, discord, email, or ai_chat.

    • dateRange object
      Hide dateRange attributes Show dateRange attributes object
      • start string(date-time)
      • end string(date-time)
    • participants array[string]
    • conversationIds array[string]
    • topics array[string]
    • legalRelevance array[string]
  • granularity string

    Values are messages, chunks, or mixed. Default value is messages.

  • topK number

    Minimum value is 1, maximum value is 100. Default value is 50.

  • rerank boolean

    Default value is true.

  • expandContext object
    Hide expandContext attributes Show expandContext attributes object
    • before number

      Default value is 0.

    • after number

      Default value is 0.

Responses

  • 200 application/json
    Hide response attributes Show response attributes object
    • data object Required
      Hide data attributes Show data attributes object
      • items array[object] Required
        Hide items attributes Show items attributes object
        • kind string Required

          Values are message or chunk.

        • id string Required

          Primary id of the item — DeviceMessage._id when kind=message, AiConversationChunk._id when kind=chunk

        • messageId string Required

          Back-compat alias for id — Phase 1 clients used this

        • source string Required

          Values are device_message, linkedin, reddit, discord, email, or ai_chat.

        • conversationId string Required
        • sender string
        • timestamp string(date-time)
        • score number Required
        • snippet string Required
        • topics array[string]

          Topic tags — only present when kind=chunk

        • expandedContext object
          Hide expandedContext attributes Show expandedContext attributes object
          • before array[object] Required
            Hide before attributes Show before attributes object
            • messageId string Required
            • text string Required
            • timestamp string(date-time) Required
          • after array[object] Required
            Hide after attributes Show after attributes object
            • messageId string Required
            • text string Required
            • timestamp string(date-time) Required
      • candidateCount number Required
      • vectorSearchTopN number Required
      • rerankApplied boolean Required
      • queryEmbeddingModel string | null
    • statusCode number Required
    • timestamp string(date-time) Required
POST /ai/cases/{caseId}/search
curl \
 --request POST 'http://api.example.com/ai/cases/{caseId}/search' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{
  "query": "string",
  "filters": {
    "sources": [
      "device_message"
    ],
    "dateRange": {
      "start": "2026-05-04T09:42:00Z",
      "end": "2026-05-04T09:42:00Z"
    },
    "participants": [
      "string"
    ],
    "conversationIds": [
      "string"
    ],
    "topics": [
      "string"
    ],
    "legalRelevance": [
      "string"
    ]
  },
  "granularity": "messages",
  "topK": 50,
  "rerank": true,
  "expandContext": {
    "before": 0,
    "after": 0
  }
}'
Request examples
{
  "query": "string",
  "filters": {
    "sources": [
      "device_message"
    ],
    "dateRange": {
      "start": "2026-05-04T09:42:00Z",
      "end": "2026-05-04T09:42:00Z"
    },
    "participants": [
      "string"
    ],
    "conversationIds": [
      "string"
    ],
    "topics": [
      "string"
    ],
    "legalRelevance": [
      "string"
    ]
  },
  "granularity": "messages",
  "topK": 50,
  "rerank": true,
  "expandContext": {
    "before": 0,
    "after": 0
  }
}
Response examples (200)
{
  "data": {
    "items": [
      {
        "kind": "message",
        "id": "65a1b2c3d4e5f6a7b8c9d0f1",
        "messageId": "65a1b2c3d4e5f6a7b8c9d0f1",
        "source": "device_message",
        "conversationId": "65a1b2c3d4e5f6a7b8c9d0f0",
        "sender": "+15555550123",
        "timestamp": "2026-01-15T10:15:00.000Z",
        "score": 0.83,
        "snippet": "I will not be at the pickup tomorrow.",
        "topics": [
          "custody",
          "scheduling"
        ],
        "expandedContext": {
          "before": [
            {
              "messageId": "65a1b2c3d4e5f6a7b8c9d0f2",
              "text": "See you at the exchange on Friday.",
              "timestamp": "2026-01-15T10:15:00.000Z"
            }
          ],
          "after": [
            {
              "messageId": "65a1b2c3d4e5f6a7b8c9d0f2",
              "text": "See you at the exchange on Friday.",
              "timestamp": "2026-01-15T10:15:00.000Z"
            }
          ]
        }
      }
    ],
    "candidateCount": 50,
    "vectorSearchTopN": 50,
    "rerankApplied": true,
    "queryEmbeddingModel": "cohere.embed-english-v3"
  },
  "statusCode": 200,
  "timestamp": "2026-01-15T10:15:00.000Z"
}