Skip to main content

Overview

The Case Briefing API provides AI-powered tools for analyzing legal case briefs, generating hypothetical scenarios, and creating study outlines. All endpoints use OpenAI GPT-4o for detailed legal analysis.

Endpoints

This section covers three case briefing endpoints:
  1. POST /api/case-briefing - Analyze user-submitted case briefs
  2. POST /api/case-briefing/hypothetical - Generate and analyze hypothetical scenarios
  3. POST /api/case-briefing/outline - Generate Constitutional Law study outlines

Case Brief Analysis

Endpoint: POST /api/case-briefing Analyze a user-submitted case brief against actual case data using IRAC methodology.

Request

caseData
object
required
The actual case information to compare against
userBrief
object
required
User’s submitted brief following IRAC format

Response

factsScore
number
Score from 0 to 1 for facts accuracy
factsFeedback
string
Detailed feedback on facts section
issueScore
number
Score from 0 to 1 for issue identification
issueFeedback
string
Feedback on issue identification
ruleScore
number
Score from 0 to 1 for rule statement
ruleFeedback
string
Feedback on legal rule
applicationScore
number
Score from 0 to 1 for application
applicationFeedback
string
Feedback on application of rule to facts
conclusionScore
number
Score from 0 to 1 for conclusion
conclusionFeedback
string
Feedback on conclusion
suggestions
array
Array of improvement suggestions
modelBrief
object
Model answer showing ideal brief structure

Example

cURL
curl -X POST 'https://api.example.com/api/case-briefing' \
  -H 'Content-Type: application/json' \
  -d '{
    "caseData": {
      "title": "Miranda v. Arizona, 384 U.S. 436 (1966)",
      "facts": "Ernesto Miranda was arrested and interrogated without being informed of his rights...",
      "issue": "Whether statements obtained from a defendant during custodial interrogation are admissible if the defendant was not informed of constitutional rights",
      "holding": "Statements are inadmissible unless defendant was informed of rights and waived them",
      "reasoning": "Fifth Amendment privilege against self-incrimination requires warnings before custodial interrogation"
    },
    "userBrief": {
      "facts": "Miranda was arrested and questioned without being told his rights",
      "issue": "Can police use statements from interrogation without warnings?",
      "rule": "Fifth Amendment protects against self-incrimination",
      "application": "Miranda was not told he could remain silent or have a lawyer",
      "conclusion": "Statements should not be allowed in court"
    }
  }'
Response
{
  "factsScore": 0.85,
  "factsFeedback": "Good summary of key facts. Consider adding more detail about the custodial nature of the interrogation.",
  "issueScore": 0.90,
  "issueFeedback": "Issue correctly identified. Could be more precise about custodial interrogation requirements.",
  "ruleScore": 0.75,
  "ruleFeedback": "Correct constitutional provision, but should state the specific warnings required.",
  "applicationScore": 0.80,
  "applicationFeedback": "Good application. Expand on why the lack of warnings violated his rights.",
  "conclusionScore": 0.85,
  "conclusionFeedback": "Correct conclusion. Could reference the exclusionary rule.",
  "suggestions": [
    "Include the specific Miranda warnings in the rule section",
    "Explain the procedural safeguards required during custodial interrogation",
    "Reference the exclusionary rule in your conclusion"
  ],
  "modelBrief": {
    "facts": "Ernesto Miranda was arrested at his home and taken to a police station where he was questioned for two hours without being advised of his constitutional rights...",
    "issue": "Whether statements obtained during custodial interrogation are admissible when the suspect was not informed of Fifth and Sixth Amendment rights",
    "rule": "The Fifth Amendment privilege against self-incrimination requires that suspects in custody be warned of their right to remain silent and right to counsel before interrogation",
    "application": "Miranda was subjected to custodial interrogation without being informed of these rights, rendering his statements involuntary under the Fifth Amendment",
    "conclusion": "The statements are inadmissible under the exclusionary rule as they were obtained in violation of Miranda's constitutional rights"
  }
}

Hypothetical Scenarios

Endpoint: POST /api/case-briefing/hypothetical Generate legal hypotheticals based on cases or analyze user responses to hypothetical scenarios.

Generate Hypothetical

caseId
string
required
Case identifier to base hypothetical on

Response

hypothetical
string
Generated hypothetical scenario

Analyze Response

hypothetical
string
required
The hypothetical scenario
userResponse
string
required
User’s legal analysis of the hypothetical

Response

issueSpottingScore
number
Score from 0 to 1 for identifying legal issues
issueSpottingFeedback
string
Feedback on issue spotting ability
reasoningScore
number
Score from 0 to 1 for legal reasoning
reasoningFeedback
string
Feedback on reasoning quality
precedentScore
number
Score from 0 to 1 for use of precedent
precedentFeedback
string
Feedback on precedent citation and application
clarityScore
number
Score from 0 to 1 for writing clarity
clarityFeedback
string
Feedback on writing clarity
suggestions
array
Improvement suggestions
modelResponse
string
Model legal analysis

Study Outline Generation

Endpoint: POST /api/case-briefing/outline Generate a comprehensive Constitutional Law study outline.

Request

userId
string
Optional user identifier for tracking

Response

success
boolean
Whether outline generation succeeded
outline
string
Plain text outline content with sections:
  • INTRODUCTION
  • THE CONSTITUTION
  • JUDICIAL REVIEW
  • FEDERALISM
  • SEPARATION OF POWERS
  • INDIVIDUAL RIGHTS
  • LANDMARK CASES
  • CONCLUSION
metadata
object
Outline metadata

Error Responses

error
string
Error message

Common Errors

Status CodeError MessageDescription
400Case data and user brief are requiredMissing required fields in brief analysis
400Case ID or hypothetical is requiredMissing required fields for hypothetical
400Invalid content typeRequest must be application/json
500Failed to process feedback from AIOpenAI response parsing failed
500Internal server errorServer-side processing error

Implementation Notes

  • All endpoints use OpenAI GPT-4o model
  • Responses are validated and cleaned to ensure valid JSON
  • Maximum token limits: 1500 for brief analysis, 1000 for hypotheticals, 2500 for outlines
  • Temperature: 0.7 for creative analysis, 0.3 for structured outlines
The case briefing endpoints require valid OpenAI API credentials configured in environment variables.

Next Steps

Case Study Analysis

Analyze full legal cases and research

Essay Analysis

Get feedback on essay responses

Writing Analysis

Analyze bar exam writing samples

Authentication

Learn about API authentication

Build docs developers (and LLMs) love