How to File Court Documents Programmatically with One API Call
This guide walks through the technical steps to file a court document using the CourtFile API. By the end, you will understand how to authenticate, submit a filing, handle fees, track status via webhooks, and test everything in sandbox mode before going live.
Prerequisites
You need a CourtFile API key. Sign up at courtfile.dasgroupllc.com/waitlist and you will receive a sandbox key within 24 hours. Sandbox keys start with cf_test_sk_ and let you make realistic API calls without submitting actual filings or incurring fees.
Step 1: Look up court and filing codes
Before filing, you need the court's identifier and the appropriate filing type code. Use the courts endpoint:
curl https://courtfile.dasgroupllc.com/v1/courts \
-H "Authorization: Bearer cf_test_sk_your_key_here"
This returns an array of supported courts with their IDs, accepted filing types, and fee schedules:
{
"courts": [
{
"id": "ca-la-superior",
"name": "Superior Court of California, County of Los Angeles",
"state": "CA",
"system": "tyler-odyssey",
"filing_types": ["motion", "complaint", "answer", "stipulation", "notice"],
"fees": {
"motion": { "filing_fee": 60.00, "efiling_fee": 5.00 }
}
}
]
}
Step 2: Submit a filing
Send a POST request to /v1/filings with the court, case details, and document URL:
curl -X POST https://courtfile.dasgroupllc.com/v1/filings \
-H "Authorization: Bearer cf_test_sk_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"court_id": "ca-la-superior",
"case_number": "23STCV01234",
"document_url": "https://your-app.com/docs/motion.pdf",
"filing_type": "motion",
"filing_description": "Motion for Summary Judgment",
"filer_name": "Jane Smith",
"filer_bar_number": "CA123456"
}'
The API validates the filing against the court's requirements, calculates fees, and returns a filing object:
{
"filing_id": "fil_abc123",
"status": "submitted",
"court_confirmation": null,
"estimated_processing": "2-4 hours",
"fees": {
"filing_fee": 60.00,
"efiling_fee": 5.00,
"total": 65.00
},
"created_at": "2026-04-16T14:30:00Z"
}
Filing fees are collected as part of the API call and passed through to the court at cost. CourtFile does not mark up filing fees. The efiling_fee is the e-filing service provider's fee, which varies by jurisdiction.
Step 3: Track status with webhooks
Rather than polling for status updates, configure a webhook URL when you create your filing (or set a default in your account settings). CourtFile sends POST requests to your webhook URL as the filing progresses:
{
"event": "filing.status_updated",
"filing_id": "fil_abc123",
"status": "confirmed",
"court_confirmation": "EF-2026-04-16-7891",
"confirmed_at": "2026-04-16T16:45:00Z"
}
Filing statuses follow this progression:
| Status | Meaning |
|---|---|
submitted | Filing received by CourtFile, being processed |
pending_review | Submitted to court, awaiting clerk review |
confirmed | Accepted by the court, confirmation number assigned |
rejected | Court rejected the filing (reason provided in webhook payload) |
If a filing is rejected, the webhook payload includes rejection_reason and court_error_codes so you can surface the issue to your user or retry with corrections. No filing fee is charged for rejected submissions.
Step 4: Retrieve filing details
You can check a filing's current status at any time:
curl https://courtfile.dasgroupllc.com/v1/filings/fil_abc123 \
-H "Authorization: Bearer cf_test_sk_your_key_here"
This returns the full filing object including current status, fees, timestamps, and the court's confirmation number once available.
Sandbox testing
Sandbox mode is designed to be a realistic simulation of the filing process. When you submit a filing with a sandbox key:
- Validation runs — Your filing is validated against real court schemas and formatting rules. If there is an issue, you get the same error response you would in production.
- Fees are calculated — Fee amounts are computed using real fee schedules, but no actual charge is made.
- Status progression fires — Webhook events are sent as the filing moves through simulated statuses, so you can test your full integration end-to-end.
- No actual filing occurs — The document is not submitted to any court system.
This means you can build and test your entire integration without risk. Once ready, swap your sandbox key for a live key (cf_live_sk_) and your code works in production without changes.
Integration patterns
Direct integration
The simplest pattern: your backend calls the CourtFile API directly when a user triggers a filing action.
import requests
def file_document(court_id, case_number, document_url, filing_type, description):
response = requests.post(
"https://courtfile.dasgroupllc.com/v1/filings",
headers={"Authorization": f"Bearer {API_KEY}"},
json={
"court_id": court_id,
"case_number": case_number,
"document_url": document_url,
"filing_type": filing_type,
"filing_description": description,
},
)
return response.json()
Batch filing
For high-volume scenarios — filing the same motion across multiple cases, or filing in bulk for a litigation support operation — the batch endpoint accepts an array of filings:
curl -X POST https://courtfile.dasgroupllc.com/v1/filings/batch \
-H "Authorization: Bearer cf_live_sk_your_key_here" \
-H "Content-Type: application/json" \
-d '{"filings": [...]}'
AI agent integration
If you are building an AI agent that handles legal workflows, the CourtFile API works as a tool the agent can call. When the agent determines a document needs to be filed, it calls the filing endpoint with the appropriate parameters. The webhook confirms completion and the agent can proceed with the next step in the workflow.
Pricing
CourtFile pricing is usage-based with no monthly minimums:
| Plan | Per-Filing Cost |
|---|---|
| Starter | $1.50 – $2.50 |
| Growth | $1.00 – $1.50 |
| Enterprise | Custom volume pricing |
Filing fees (the fees courts charge to accept a document) are always passed through at cost with no markup.
Next steps
- Join the waitlist at courtfile.dasgroupllc.com/waitlist to get your sandbox API key
- Read the full API docs at courtfile.dasgroupllc.com/docs
- Test in sandbox — submit filings, receive webhook events, and validate your integration
- Go live — swap to a live key when you are ready to file with real courts
Related workflows
If this topic matters to your team, these CourtFile workflow pages are usually the next useful step.
Deadline Extraction
CourtFile helps litigation teams extract deadlines from court orders, notices, and motion papers into a verified list with source references.
Matter Briefs
CourtFile turns filing packets and dockets into a verified matter brief that litigation teams can review, share, and export.
Motion Review
CourtFile helps litigation teams review motion packets faster by extracting relief sought, arguments, dates, citations, and missing supporting materials.
Get future CourtFile notes in your inbox
We send new posts on litigation workflow design, filing review, deadline extraction, and matter handoff process.
Need this workflow in your team?
Request access to CourtFile and we'll scope the right filing-review workflow for your matters.
Request Access