🤖 Judit API error responses always return a JSON object containing the root keyerror. Insideerror, the standard keys arename(the internal error code),message(the error group), anddata(an array of strings with the details or validation messages).
HTTP Status Codes
The API uses the standard conventions of the HTTP protocol to indicate the success or failure of a request.Success (2xx)
- 200 OK: Request processed and data returned successfully.
- 201 Created: Resource (e.g., a new tracking) created successfully.
- 202 Accepted: Request accepted and sent to the asynchronous processing queue.
Client Errors (4xx)
- 400 Bad Request: Required parameters are missing or malformed.
- 401 Unauthorized: The
api-keyheader is missing, incorrect, or the key has expired. - 403 Forbidden: Valid key, but no permission to access that resource/endpoint.
- 404 Not Found: The resource (e.g., lawsuit number) does not exist in the base.
- 422 Unprocessable Entity: Data is in the correct format but not processable (e.g., mathematically invalid CNJ).
- 429 Too Many Requests: Rate limit per minute exceeded.
Server Errors (5xx)
- 500 Internal Server Error: Internal failure in the Judit API.
- 502 Bad Gateway / 503 Service Unavailable: Temporary instability of infrastructure or of the courts.
- 504 Gateway Timeout: The court took too long to respond to the extraction.
Error Structure (Payload)
Regardless of the HTTP status (whether 400 or 500), the error response body always follows this predictable JSON contract:Payload Dictionary
name: Internal code of the exception. Use this field in your code (switch/case) for automation.message: Friendly category of the error.data: Array of strings containing the specific failures (very useful for displaying form validations to the end user).
Common Internal Codes (name)
Below are the main values that the name key can take, helping you handle the problem programmatically:
Authentication and Permissions
Code (name) | HTTP Status | Common Cause |
|---|---|---|
USER_NOT_FOUND | 401 | API Key not sent in the header, or key revoked. |
INSUFFICIENT_PERMISSIONS | 403 | Attempt to use a module that is blocked in your plan. |
Processing and Validation
Code (name) | HTTP Status | Common Cause |
|---|---|---|
HttpBadRequestError | 400 | You sent malformed JSON or missing fields. |
RESOURCE_NOT_FOUND | 404 | You tried to look up a CNJ that has not yet been captured. |
REQUEST_NOT_FOUND | 404 | The request_id you queried does not exist in the base. |
PROCESSING_ERROR | 422 | The crawler failed to read the data at the court. |
Code-level Handling Strategies
Best practice is to create a centralized handler (interceptor) in your application to log and handle Judit API errors.Next Steps
- 👉 Rate Limits: See how to build the Retry with Exponential Backoff function to handle
429errors. - 👉 Authentication: Review how to send your credentials correctly to avoid
401errors. - 👉 FAQ: Read answers to the most common integration problems.