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:- POST /api/case-briefing - Analyze user-submitted case briefs
- POST /api/case-briefing/hypothetical - Generate and analyze hypothetical scenarios
- 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
The actual case information to compare against
User’s submitted brief following IRAC format
Response
Score from 0 to 1 for facts accuracy
Detailed feedback on facts section
Score from 0 to 1 for issue identification
Feedback on issue identification
Score from 0 to 1 for rule statement
Feedback on legal rule
Score from 0 to 1 for application
Feedback on application of rule to facts
Score from 0 to 1 for conclusion
Feedback on conclusion
Array of improvement suggestions
Model answer showing ideal brief structure
Example
cURL
Response
Hypothetical Scenarios
Endpoint:POST /api/case-briefing/hypothetical
Generate legal hypotheticals based on cases or analyze user responses to hypothetical scenarios.
Generate Hypothetical
Case identifier to base hypothetical on
Response
Generated hypothetical scenario
Analyze Response
The hypothetical scenario
User’s legal analysis of the hypothetical
Response
Score from 0 to 1 for identifying legal issues
Feedback on issue spotting ability
Score from 0 to 1 for legal reasoning
Feedback on reasoning quality
Score from 0 to 1 for use of precedent
Feedback on precedent citation and application
Score from 0 to 1 for writing clarity
Feedback on writing clarity
Improvement suggestions
Model legal analysis
Study Outline Generation
Endpoint:POST /api/case-briefing/outline
Generate a comprehensive Constitutional Law study outline.
Request
Optional user identifier for tracking
Response
Whether outline generation succeeded
Plain text outline content with sections:
- INTRODUCTION
- THE CONSTITUTION
- JUDICIAL REVIEW
- FEDERALISM
- SEPARATION OF POWERS
- INDIVIDUAL RIGHTS
- LANDMARK CASES
- CONCLUSION
Outline metadata
Error Responses
Error message
Common Errors
| Status Code | Error Message | Description |
|---|---|---|
| 400 | Case data and user brief are required | Missing required fields in brief analysis |
| 400 | Case ID or hypothetical is required | Missing required fields for hypothetical |
| 400 | Invalid content type | Request must be application/json |
| 500 | Failed to process feedback from AI | OpenAI response parsing failed |
| 500 | Internal server error | Server-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