Skip to main content
POST
/
api
/
v1
/
classify
curl -X POST https://api.courtrules.app/api/v1/classify \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "judge_slug": "carol-bagley-amon",
    "district_id": "edny",
    "text": "UNITED STATES DISTRICT COURT\nEASTERN DISTRICT OF NEW YORK\n\nJOHN DOE, Plaintiff,\nv.\nACME CORP, Defendant.\n\nCase No. 24-cv-1234\n\nMEMORANDUM OF LAW IN SUPPORT OF\nMOTION FOR SUMMARY JUDGMENT\n\n...",
    "filename": "memo_in_support_sj.pdf"
  }'
{
  "classification": {
    "document_scope": "brief_support",
    "motion_type": "Rule_56",
    "confidence": "high",
    "reasoning": "Document is titled 'Memorandum of Law in Support of Motion for Summary Judgment', contains Rule 56 references, and includes a statement of undisputed material facts."
  },
  "document": {
    "page_count": 31,
    "word_count": 10000,
    "caption": {
      "present": true,
      "has_court_name": true,
      "has_case_title": true,
      "has_docket_number": true,
      "has_document_designation": true
    },
    "sections": {
      "has_toc": true,
      "has_toa": true,
      "has_certificate_of_compliance": false,
      "has_certificate_of_service": true,
      "has_numbered_paragraphs": false,
      "has_56_1_statement": true,
      "has_56_1_counterstatement": false,
      "has_proposed_amended_pleading": false,
      "has_verbatim_discovery_text": false,
      "has_conferral_certification": false,
      "has_notice_of_motion": true,
      "has_memorandum_of_law": true,
      "has_supporting_affidavits": true,
      "has_pro_se_sj_notice": false
    }
  },
  "check_request": {
    "judge_slug": "carol-bagley-amon",
    "district_id": "edny",
    "document_scope": "brief_support",
    "motion_type": "Rule_56",
    "document": {
      "page_count": 31,
      "word_count": 10000,
      "caption": {
        "present": true,
        "has_court_name": true,
        "has_case_title": true,
        "has_docket_number": true,
        "has_document_designation": true
      },
      "sections": {
        "has_toc": true,
        "has_toa": true,
        "has_certificate_of_compliance": false,
        "has_certificate_of_service": true,
        "has_numbered_paragraphs": false,
        "has_56_1_statement": true,
        "has_56_1_counterstatement": false,
        "has_proposed_amended_pleading": false,
        "has_verbatim_discovery_text": false,
        "has_conferral_certification": false,
        "has_notice_of_motion": true,
        "has_memorandum_of_law": true,
        "has_supporting_affidavits": true,
        "has_pro_se_sj_notice": false
      }
    }
  }
}

Classify Document

POST /api/v1/classify
Analyzes document text using an LLM to determine its type, extract structural metadata, and produce a ready-to-send request body for the /check endpoint. This is the bridge between raw document text and structured compliance checking. Note: This endpoint calls an LLM and may take 5-15 seconds to respond.

Request

judge_slug
string
required
Judge slug identifier (e.g. gary-r-brown)
district_id
string
required
District identifier (e.g. edny)
text
string
required
The document text to classify. The first 15,000 characters are analyzed.
filename
string
Optional filename hint (e.g. motion_for_summary_judgment.pdf). Helps the LLM classify ambiguous documents.
curl -X POST https://api.courtrules.app/api/v1/classify \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "judge_slug": "carol-bagley-amon",
    "district_id": "edny",
    "text": "UNITED STATES DISTRICT COURT\nEASTERN DISTRICT OF NEW YORK\n\nJOHN DOE, Plaintiff,\nv.\nACME CORP, Defendant.\n\nCase No. 24-cv-1234\n\nMEMORANDUM OF LAW IN SUPPORT OF\nMOTION FOR SUMMARY JUDGMENT\n\n...",
    "filename": "memo_in_support_sj.pdf"
  }'
{
  "classification": {
    "document_scope": "brief_support",
    "motion_type": "Rule_56",
    "confidence": "high",
    "reasoning": "Document is titled 'Memorandum of Law in Support of Motion for Summary Judgment', contains Rule 56 references, and includes a statement of undisputed material facts."
  },
  "document": {
    "page_count": 31,
    "word_count": 10000,
    "caption": {
      "present": true,
      "has_court_name": true,
      "has_case_title": true,
      "has_docket_number": true,
      "has_document_designation": true
    },
    "sections": {
      "has_toc": true,
      "has_toa": true,
      "has_certificate_of_compliance": false,
      "has_certificate_of_service": true,
      "has_numbered_paragraphs": false,
      "has_56_1_statement": true,
      "has_56_1_counterstatement": false,
      "has_proposed_amended_pleading": false,
      "has_verbatim_discovery_text": false,
      "has_conferral_certification": false,
      "has_notice_of_motion": true,
      "has_memorandum_of_law": true,
      "has_supporting_affidavits": true,
      "has_pro_se_sj_notice": false
    }
  },
  "check_request": {
    "judge_slug": "carol-bagley-amon",
    "district_id": "edny",
    "document_scope": "brief_support",
    "motion_type": "Rule_56",
    "document": {
      "page_count": 31,
      "word_count": 10000,
      "caption": {
        "present": true,
        "has_court_name": true,
        "has_case_title": true,
        "has_docket_number": true,
        "has_document_designation": true
      },
      "sections": {
        "has_toc": true,
        "has_toa": true,
        "has_certificate_of_compliance": false,
        "has_certificate_of_service": true,
        "has_numbered_paragraphs": false,
        "has_56_1_statement": true,
        "has_56_1_counterstatement": false,
        "has_proposed_amended_pleading": false,
        "has_verbatim_discovery_text": false,
        "has_conferral_certification": false,
        "has_notice_of_motion": true,
        "has_memorandum_of_law": true,
        "has_supporting_affidavits": true,
        "has_pro_se_sj_notice": false
      }
    }
  }
}

Response fields

classification
object
LLM’s analysis of the document type
document
object
Extracted document metadata including page count, word count, and any structural elements the LLM could identify (caption, sections, format, privacy).
check_request
object
A complete request body ready to send to POST /api/v1/check. Includes judge_slug, district_id, document_scope, motion_type (if detected), and the full document object.

Error responses

CodeMeaning
400Invalid request (missing text, invalid judge_slug, etc.)
403District not accessible
502LLM classification failed (timeout, invalid response, etc.)

Usage pattern

The typical flow is classify, then check:
POST /classify  →  get check_request  →  POST /check
The check_request field in the classify response is designed to be passed directly as the body to /check with no modification needed. You can also inspect the classification to show the user what was detected before running the compliance check.