New CNPJ format (IN 2229/24)Judit already accepts the new alphanumeric CNPJ format in compliance with the Brazilian Federal Revenue Normative Instruction No. 2229/2024.
- Zero effort: no changes are required in your integration.
- Test environment: use the document
A1B2C3D4/E5F6-68to validate the flow and receive a mock lawsuit in response.
Cached response (
cached_response)When you create a lawsuit or historical query, Judit first checks whether the data already exists in our database. If it does, we return the result immediately — both in the API response and via webhook (if registered) — with the field cached_response: true.In parallel, Judit triggers a fresh fetch against the courts. If anything has changed, you receive a second response with cached_response: false. That is the most up-to-date result.This is why it is normal to receive two seemingly identical webhooks for the same request_id:- The first one comes from cache (
cached_response: true) - The last one is the updated result (
cached_response: false)
This page documents exclusively the Asynchronous flow of the Historical Query. The client must make aPOST /requests, wait for processing (GET /requests/{id}), and retrieve the data atGET /responses. The Historical Query response returns a paginated array containing exclusively the Header and the Parties of the lawsuit (omitting case updates, attachments, phase, and status). You can filter the results either in the payload of the initial POST or in the query strings of the final GET.
When to use
Due diligence / KYC
Before signing a contract, discover the counterpart’s full judicial exposure by CPF/CNPJ.
Credit and collections
Combine with filters (
amount_gte, side: "Passive") to prioritize outreach by claim amount.Caseload watch
Cross-reference with Tracking by document to detect new lawsuits after the initial query.
Lawyer intelligence (OAB)
Query by OAB to list every lawsuit a lawyer is involved in.
Synchronous vs. Asynchronous
Before integrating, it is essential to understand the architectural difference that Judit offers for this endpoint:- Synchronous Query (Datalake Hotstorage): The response with all lawsuits is returned instantly in the
bodyof thePOSTitself. It does not require a status check. Ideal for flows sensitive to response latency, such as onboarding. See the Synchronous documentation here. - Asynchronous Query (Datalake / On-Demand): This is the flow we will cover on this page. It searches multiple external sources or directly in the courts (On-Demand) in real time. It requires a 3-step flow (Create -> Check -> Consume).
Step 1: Create the Search Request (POST)
To initiate the asynchronous flow, make aPOST request providing the desired document.
POST https://requests.production.judit.io/requests
Historical query examples
Base Payload Parameters
About the use of
customer_key: This credential will only take effect if the on_demand parameter is set to true. When provided, Judit will access the courts in an authenticated manner, allowing the capture of lawsuits under judicial secrecy to which the credential owner (lawyer) is previously linked within the respective lawsuit.Prior Request Filters (search_params.filter)
You can restrict the initial search by sending the filter object inside search_params in the body of your POST. This is highly recommended, as it prevents the bot from spending time processing courts or states or years that are not relevant to your business.
Below, we detail how to build each filter step by step.
1. Pole and Case Value Filters
Allows you to search for lawsuits in which the person has sued someone, has been sued, or filter by amounts in reais.side(string): Which side of the lawsuit is the searched document on?"Active"(Plaintiff)"Passive"(Defendant)"Interested"(Third-party interested)"Unknown"(Pole not identified)
amount_gte(number): Case value Greater than or Equal to (GTE = Greater Than or Equal).amount_lte(number): Case value Less than or Equal to (LTE = Less Than or Equal).
2. Court Filters (Include and Exclude Rule)
To filter by specific states or courts, we use thetribunals object. It requires two pieces of information: the list of acronyms (keys) and a negation rule (not_equal).
List of Accepted Courts (Filters)
Use the exact acronyms from the Acronym (Key) column below when filtering by courts (e.g., in thetribunals.keys parameter).
Superior Courts and Councils
Superior Courts and Councils
Federal Justice (TRF)
Federal Justice (TRF)
Labor Justice (TRT)
Labor Justice (TRT)
State Justice (TJ)
State Justice (TJ)
Electoral Justice (TRE)
Electoral Justice (TRE)
Military Justice (Federal and State)
Military Justice (Federal and State)
- Inclusion: If
not_equalisfalse, the API will search ONLY in the courts from the list. - Exclusion: If
not_equalistrue, the API will search throughout Brazil, EXCEPT in the courts from the list.
JSON Example: Including vs. Excluding Courts
JSON Example: Including vs. Excluding Courts
3. Subject and Class Filters (CNJ Standard)
The Judit API uses the official Unified Procedural Tables (TPU) from the National Council of Justice (CNJ). You can filter lawsuits by entering the exact numeric codes from these tables. 👉 To find out the official codes for Classes and Subjects, visit the Public Query of SGT/CNJ. The filter mechanics work as follows:- Subjects (
subject_codes): Uses the listscontains(I want lawsuits that contain these codes) andnot_contains(I do not want lawsuits that contain these codes). - Classes (
classification_codes): Uses thekeyslist and thenot_equalrule (the same inclusion/exclusion logic as courts).
JSON Example: Filtering by Subjects and Classes
JSON Example: Filtering by Subjects and Classes
4. Date and Deadline Filters
Optimize the search by time slices using the universal date format (ISO 8601:YYYY-MM-DDTHH:mm:ss.sssZ).
distribution_date_gte(string): Returns lawsuits filed (initiated) on or after a date.last_step_date_gte(string): Returns lawsuits whose last case update occurred on or after a date.last_step_date_lte(string): Returns lawsuits whose last case update occurred before a date.
JSON Example: Filtering by Dates
JSON Example: Filtering by Dates
5. Restrictive Filters for Other Parties
Want to know if João sued Company X? You can use the Names and Documents filters of other parties involved in the lawsuit.party_names(array of strings): List of exact names that must appear in the lawsuit.party_documents(array of strings): List of CPFs/CNPJs that must appear in the lawsuit.
Note when using together with the
side filter: If you use the party_names or party_documents filter together with the side filter, the “Pole” rule (Plaintiff/Defendant) will only be applied to the main document you are searching for, and not to the extra names/documents listed here.JSON Example: Specific Parties
JSON Example: Specific Parties
Request Example (POST)
request_id (e.g., 05ee9825...) generated in the response of this call. It is your passport to the next steps.
🚀 Shortcut: Automate with Webhooks (Recommended)If you have a Webhook URL configured, Steps 2 and 3 below are entirely optional.
Instead of programming your application to keep polling the request status, the Judit API will send the found lawsuits incrementally directly to your server as soon as they are captured, finishing the flow with a
request_completed event.👉 Learn how to configure and receive Webhooks hereStep 2: Check the Request Status
Since a document can be linked to hundreds of lawsuits in Brazil, collection takes time. You must check the macro status of the request using the ID from Step 1.GET https://requests.production.judit.io/requests/<REQUEST_ID>
cURL (Step 2)
"status" property changes from "pending" to "completed".
(Note: Using Webhooks eliminates the need for this step).
Granular Verification (On-Demand Only)
Since the On-Demand search queries dozens of systems simultaneously, you can track the individual status of each accessed court using the Crawls route:cURL
See example of On-Demand Status Response
See example of On-Demand Status Response
Step 3: Consume and Filter the Results (GET)
As soon as the status in Step 2 returns"completed", the data is ready!
This is where, on the GET /responses route, you pull the final JSON. The big advantage of this endpoint is that it allows you to apply dynamic filters via URL (Query Params), allowing you to slice, order, and paginate the final response however you want, without having to generate a new request (POST).
GET https://requests.production.judit.io/responses/
Dynamic URL Filters (Query Params)
These are the parameters you can concatenate to your final request:The Response Format
The return provides the pagination keys and thepage_data array, where each object contains the response_data (The Lawsuit Header).
string
Final status of the response (Must be
completed).integer
Current page of the search.
integer
Total number of lawsuits rendered on this page.
integer
Absolute total of lawsuits found and linked to the document.
integer
Total number of available pages.
array
Array of objects. Each object contains the
response_data key that holds the Lawsuit Header.Ver Exemplo da Estrutura do Processo Retornado
Ver Exemplo da Estrutura do Processo Retornado