Update the AI case context

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/cases/{caseId}/context

Sets the fields sent and marks each as attorney-stated. version goes up when a field that steers the AI (case type, jurisdiction, theory, claims, what to prove, parties, dates or date range) actually changes. Returns the updated context. Requires owner or admin access to the case and an active plan (403 otherwise); not available to opposing counsel.

Path parameters

  • caseId string Required
application/json

Body Required

  • caseType string | null
  • jurisdiction string | null
  • theoryOfCase string | null
  • whatToProve array[string]
  • legalClaims array[object]
    Hide legalClaims attributes Show legalClaims attributes object
    • id string Required
    • claim string Required
    • statuteCitation string | null
    • elements array[object]
      Hide elements attributes Show elements attributes object
      • id string Required
      • description string Required
    • source string

      Values are complaint, attorney_stated, or amended_filing.

  • keyParties array[object]
    Hide keyParties attributes Show keyParties attributes object
    • name string Required
    • aliases array[string]
    • role string

      Values are petitioner, respondent, plaintiff, defendant, child, witness, third_party, or other.

    • handles array[string]
    • significance string | null
  • keyDates array[object]
    Hide keyDates attributes Show keyDates attributes object
    • date string(date-time) Required
    • event string Required
    • significance string | null
  • relevantDateRange object
    Hide relevantDateRange attributes Show relevantDateRange attributes object
    • start string(date-time)
    • end string(date-time)
  • sourceDocuments array[string]

Responses

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

      The AI case context profile.

      Hide data attributes Show data attributes object
      • _id string
      • case string
      • organization string
      • caseType string | null
      • jurisdiction string | null
      • theoryOfCase string | null
      • legalClaims array[object]
        Hide legalClaims attributes Show legalClaims attributes object
        • id string
        • claim string
        • statuteCitation string | null
        • elements array[object]
          Hide elements attributes Show elements attributes object
          • id string
          • description string
        • source string

          Values are complaint, attorney_stated, or amended_filing.

      • whatToProve array[string]
      • keyParties array[object]
        Hide keyParties attributes Show keyParties attributes object
        • name string
        • aliases array[string]
        • role string

          Values are petitioner, respondent, plaintiff, defendant, child, witness, third_party, or other.

        • handles array[string]
        • significance string | null
      • keyDates array[object]
        Hide keyDates attributes Show keyDates attributes object
        • date string(date-time)
        • event string
        • significance string | null
      • relevantDateRange object | null
        Hide relevantDateRange attributes Show relevantDateRange attributes object | null
        • start string(date-time)
        • end string(date-time)
      • sourceDocuments array[string]
      • authoredBy string
      • confirmedByAttorney boolean
      • fieldProvenance object

        Per field: attorney_stated, ai_extracted or ai_extracted_confirmed.

        Hide fieldProvenance attribute Show fieldProvenance attribute object
        • * string Additional properties
      • extractionModelVersion string | null
      • version number
      • createdAt string(date-time) | null
      • updatedAt string(date-time) | null
    • statusCode number Required
    • timestamp string(date-time) Required
PATCH /ai/cases/{caseId}/context
curl \
 --request PATCH 'http://api.example.com/ai/cases/{caseId}/context' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{
  "caseType": "string",
  "jurisdiction": "string",
  "theoryOfCase": "string",
  "whatToProve": [
    "string"
  ],
  "legalClaims": [
    {
      "id": "string",
      "claim": "string",
      "statuteCitation": "string",
      "elements": [
        {
          "id": "string",
          "description": "string"
        }
      ],
      "source": "complaint"
    }
  ],
  "keyParties": [
    {
      "name": "string",
      "aliases": [
        "string"
      ],
      "role": "petitioner",
      "handles": [
        "string"
      ],
      "significance": "string"
    }
  ],
  "keyDates": [
    {
      "date": "2026-05-04T09:42:00Z",
      "event": "string",
      "significance": "string"
    }
  ],
  "relevantDateRange": {
    "start": "2026-05-04T09:42:00Z",
    "end": "2026-05-04T09:42:00Z"
  },
  "sourceDocuments": [
    "string"
  ]
}'
Request examples
{
  "caseType": "string",
  "jurisdiction": "string",
  "theoryOfCase": "string",
  "whatToProve": [
    "string"
  ],
  "legalClaims": [
    {
      "id": "string",
      "claim": "string",
      "statuteCitation": "string",
      "elements": [
        {
          "id": "string",
          "description": "string"
        }
      ],
      "source": "complaint"
    }
  ],
  "keyParties": [
    {
      "name": "string",
      "aliases": [
        "string"
      ],
      "role": "petitioner",
      "handles": [
        "string"
      ],
      "significance": "string"
    }
  ],
  "keyDates": [
    {
      "date": "2026-05-04T09:42:00Z",
      "event": "string",
      "significance": "string"
    }
  ],
  "relevantDateRange": {
    "start": "2026-05-04T09:42:00Z",
    "end": "2026-05-04T09:42:00Z"
  },
  "sourceDocuments": [
    "string"
  ]
}
Response examples (200)
{
  "data": {
    "_id": "65a1b2c3d4e5f6a7b8c9d0e1",
    "case": "65a1b2c3d4e5f6a7b8c9d0e2",
    "organization": "65a1b2c3d4e5f6a7b8c9d0e3",
    "caseType": "custody",
    "jurisdiction": "California",
    "theoryOfCase": "string",
    "legalClaims": [
      {
        "id": "string",
        "claim": "string",
        "statuteCitation": "string",
        "elements": [
          {
            "id": "string",
            "description": "string"
          }
        ],
        "source": "complaint"
      }
    ],
    "whatToProve": [
      "string"
    ],
    "keyParties": [
      {
        "name": "string",
        "aliases": [
          "string"
        ],
        "role": "petitioner",
        "handles": [
          "string"
        ],
        "significance": "string"
      }
    ],
    "keyDates": [
      {
        "date": "2026-05-04T09:42:00Z",
        "event": "string",
        "significance": "string"
      }
    ],
    "relevantDateRange": {
      "start": "2026-05-04T09:42:00Z",
      "end": "2026-05-04T09:42:00Z"
    },
    "sourceDocuments": [
      "string"
    ],
    "authoredBy": "65a1b2c3d4e5f6a7b8c9d0e4",
    "confirmedByAttorney": false,
    "fieldProvenance": {
      "theoryOfCase": "attorney_stated"
    },
    "extractionModelVersion": "string",
    "version": 2,
    "createdAt": "2026-01-15T10:15:00.000Z",
    "updatedAt": "2026-01-15T10:15:00.000Z"
  },
  "statusCode": 200,
  "timestamp": "2026-01-15T10:15:00.000Z"
}