{
  "openapi": "3.0.1",
  "info": {
    "title": "Brazil Court Cases - DataJud CNJ (Processos Judiciais)",
    "description": "Fetch Brazilian court case metadata and full movement history from the official CNJ DataJud public API. Batch lookup by case number with automatic court detection.",
    "version": "0.1",
    "x-build-id": "ky9muzufxgjOTgfH4"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/sadzinn~datajud-processos-brasil/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-sadzinn-datajud-processos-brasil",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/sadzinn~datajud-processos-brasil/runs": {
      "post": {
        "operationId": "runs-sync-sadzinn-datajud-processos-brasil",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/sadzinn~datajud-processos-brasil/run-sync": {
      "post": {
        "operationId": "run-sync-sadzinn-datajud-processos-brasil",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "processNumbers": {
            "title": "Case numbers (numeros de processo)",
            "type": "array",
            "description": "Brazilian unified case numbers (numero unico CNJ), with or without punctuation. Example: 1500133-05.2025.8.26.0159. The court is detected automatically from the number.",
            "items": {
              "type": "string"
            }
          },
          "tribunalAlias": {
            "title": "Court alias (optional override)",
            "type": "string",
            "description": "Force a specific court alias (e.g. tjsp, trf3, trt2, stj). Leave empty for automatic detection from each case number."
          },
          "includeMovements": {
            "title": "Include full movement history",
            "type": "boolean",
            "description": "If enabled, each result includes the complete list of case movements (movimentos). Disable for lighter results with only case metadata.",
            "default": true
          },
          "onlyNewMovements": {
            "title": "Monitoring mode: only cases with NEW movements",
            "type": "boolean",
            "description": "Turn this on for scheduled monitoring (monitoramento processual). The actor remembers each case's last movement and returns only cases that moved since the previous run, with a novosMovimentos field listing exactly what changed. Perfect for daily alerts via webhook.",
            "default": false
          },
          "monitorName": {
            "title": "Monitor name (separate monitoring state)",
            "type": "string",
            "description": "Optional label to isolate the monitoring memory, e.g. 'client-acme'. Leave empty and the state is keyed automatically by your case list."
          },
          "searchTribunal": {
            "title": "[Search mode] Court alias to search",
            "type": "string",
            "description": "Search mode (use when no case numbers are given): court alias to query, e.g. tjsp."
          },
          "searchClasseCodigo": {
            "title": "[Search mode] Class code (codigo da classe CNJ)",
            "type": "integer",
            "description": "Filter by CNJ class code, e.g. 1116 for tax enforcement (execucao fiscal)."
          },
          "searchOrgaoCodigo": {
            "title": "[Search mode] Court body code (codigo orgao julgador)",
            "type": "integer",
            "description": "Filter by orgao julgador code."
          },
          "searchDateFrom": {
            "title": "[Search mode] Filed from (dataAjuizamento >=)",
            "type": "string",
            "description": "ISO date, e.g. 2025-01-01"
          },
          "searchDateTo": {
            "title": "[Search mode] Filed until (dataAjuizamento <=)",
            "type": "string",
            "description": "ISO date, e.g. 2025-12-31"
          },
          "maxResults": {
            "title": "[Search mode] Max results",
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum number of cases returned in search mode (API caps at 10000).",
            "default": 100
          },
          "apiKey": {
            "title": "DataJud API key",
            "type": "string",
            "description": "Optional. Defaults to the official CNJ public key. Override only if CNJ rotates the key before this actor is updated."
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}