β β―bash python scripts/main.py
or
Test Link - https://schema-forge.onrender.com/docs#/
git clone https://github.com/sudharshanreddyt/schema_forge.git
cd schema_forgepython -m venv venv
source venv/bin/activatepip install -r requirements.txtReplace the values in the .env file with your own values
PG_DB=<db_name>
PG_USER=<db_user>
PG_PASSWORD=<db_password>
PG_HOST=<db_host>
PG_PORT=<db_port>PROJECT_NAME=<project_name>
Run the following command from the root directory of the project:
python -m uvicorn app.main:app --host 127.0.0.1 --port 8000It will start the server at http://localhost:8000 and the API documentation at http://localhost:8000/docs
This document provides a comprehensive overview of the available API endpoints for the SchemaForge Legal Database, including detailed example inputs for every single route.
The API is served at: http://localhost:8000/docs
Manage legal jurisdictions (States, Federal, International).
- Endpoint:
GET /jurisdictions/ - Description: Retrieve a list of jurisdictions.
- Example Usage:
GET /jurisdictions/?skip=0&limit=5
- Endpoint:
POST /jurisdictions/ - Example Input:
{
"court_name": "Supreme Court of California",
"jurisdiction_type": "U.S. State",
"jurisdiction_name": "California"
}- Endpoint:
GET /jurisdictions/{id} - Example Usage:
GET /jurisdictions/1
The core entity representing legal cases.
- Endpoint:
GET /cases/ - Description: Retrieve a list of cases. Skip is the number of records to skip and limit is the number of records to retrieve.
- Example Usage:
GET /cases/?skip=0&limit=3
- Endpoint:
GET /cases/search/ - Description: Filter cases by various fields (case_id, slug, caption, filing_date, etc.).
- Example Usage:
GET /cases/search/?case_id=323&caption=Smith
- Endpoint:
POST /cases/ - Example Input:
{
"slug": "smith-v-jones-2024",
"record_number": 123456,
"caption": "John Smith v. Jane Jones",
"brief_description": "A landmark case regarding AI ethics and liability.",
"filing_date": "2024-01-15",
"status_disposition": "Pending",
"published_opinion_flag": true,
"class_action_status": "Individual",
"researcher": "Dr. Alice Brown",
"summary_of_significance": "First case to address algorithmic bias directly.",
"summary_facts_activity": "Facts regarding the deployment of the biased algorithm...",
"most_recent_activity": "Initial hearing held.",
"most_recent_activity_date": "2024-02-10",
"date_added": "2024-01-20",
"last_update": "2024-02-11",
"jurisdiction_id": 129,
"area_ids": [129],
"issue_ids": [129, 129],
"cause_ids": [129],
"algorithm_ids": [129],
"organization_ids": [129]
}- Endpoint:
GET /cases/{id} - Example Usage:
GET /cases/1 - Note: Returns nested objects for jurisdiction, dockets, documents, and taxonomy associations.
- Endpoint:
PUT /cases/{id} - Example Input:
{
"status_disposition": "Resolved",
"most_recent_activity": "Case dismissed with prejudice.",
"last_update": "2024-03-01",
"area_ids": [1, 2, 3]
}- Endpoint:
DELETE /cases/{id} - Example Usage:
DELETE /cases/1 - Warning: This will also delete all associated dockets, documents, and secondary sources due to CASCADE delete.
Court dockets associated with cases.
- Endpoint:
GET /dockets/ - Example Usage:
GET /dockets/
- Endpoint:
GET /dockets/search/ - Example Usage:
GET /dockets/search/?case_id=1&court=Superior
- Endpoint:
POST /dockets/ - Example Input:
{
"case_id": 1,
"court": "California Superior Court",
"docket_number": "CIV-2024-456",
"link": "https://court-portal.ca.gov/case/123"
}- Endpoint:
GET /dockets/{id} - Example Usage:
GET /dockets/1
- Endpoint:
PUT /dockets/{id} - Example Input:
{
"docket_number": "CIV-2024-456-AMENDED",
"link": "https://court-portal.ca.gov/case/123-revised"
}- Endpoint:
DELETE /dockets/{id} - Example Usage:
DELETE /dockets/1
Legal documents linked to dockets.
- Endpoint:
GET /documents/ - Example Usage:
GET /documents/
- Endpoint:
GET /documents/search/ - Example Usage:
GET /documents/search/?document_type=Complaint
- Endpoint:
POST /documents/ - Example Input:
{
"docket_id": 1,
"document_type": "Complaint",
"filing_date": "2024-01-15",
"link": "https://storage.ca.gov/docs/complaint.pdf",
"citation": "2024 Cal. Super. LEXIS 123"
}- Endpoint:
GET /documents/{id} - Example Usage:
GET /documents/1
- Endpoint:
PUT /documents/{id} - Example Input:
{
"document_type": "Amended Complaint",
"link": "https://storage.ca.gov/docs/complaint_v2.pdf"
}- Endpoint:
DELETE /documents/{id} - Example Usage:
DELETE /documents/1
External sources and citations related to cases.
- Endpoint:
GET /secondary-sources/ - Example Usage:
GET /secondary-sources/
- Endpoint:
GET /secondary-sources/search/ - Example Usage:
GET /secondary-sources/search/?title=Analysis
- Endpoint:
POST /secondary-sources/ - Example Input:
{
"case_id": 1,
"title": "Analysis of Smith v. Jones: AI Liability Trends",
"link": "https://lawreview.edu/articles/ai-liability"
}- Endpoint:
GET /secondary-sources/{id} - Example Usage:
GET /secondary-sources/1
- Endpoint:
PUT /secondary-sources/{id} - Example Input:
{
"title": "Comprehensive Analysis of Smith v. Jones",
"link": "https://lawreview.edu/articles/ai-liability-v2"
}- Endpoint:
DELETE /secondary-sources/{id} - Example Usage:
DELETE /secondary-sources/1
Manage categorizations for legal analytics. These categories are linked to Cases.
- GET
/taxonomies/areas/: List all areas. - POST
/taxonomies/areas/: Create area.{ "name": "Consumer Protection" }
- GET
/taxonomies/issues/: List all issues. - POST
/taxonomies/issues/: Create issue.{ "name": "Algorithmic Bias" }
- GET
/taxonomies/causes/: List all causes. - POST
/taxonomies/causes/: Create cause.{ "name": "Negligence" }
- GET
/taxonomies/algorithms/: List all algorithms. - POST
/taxonomies/algorithms/: Create algorithm.{ "name": "Predictive Policing Model v1" }
- GET
/taxonomies/organizations/: List all organizations. - POST
/taxonomies/organizations/: Create organization.{ "name": "Tech Corp Inc." } - GET
/taxonomies/organizations/search/: Search organizations by name.
- Render Deployment: See render.yaml and deployment_guide.md for instructions.
- Swagger UI: http://localhost:8000/docs (Best for interactive testing)