{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/parallel-ai/json-schema/parallel-ai-find-all-run-result-schema.json",
  "title": "FindAllRunResult",
  "description": "Complete FindAll search results.\n\nRepresents a snapshot of a FindAll run, including run metadata and a list of\ncandidate entities with their match status and details at the time the snapshot was\ntaken.",
  "x-generated": "2026-11-17",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/parallel-ai-findall-api-openapi.yml#/components/schemas/FindAllRunResult",
  "properties": {
    "run": {
      "$ref": "#/$defs/FindAllRun",
      "description": "FindAll run object."
    },
    "candidates": {
      "items": {
        "$ref": "#/$defs/FindAllCandidate"
      },
      "type": "array",
      "title": "Candidates",
      "description": "All evaluated candidates at the time of the snapshot."
    },
    "last_event_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Last Event Id",
      "description": "ID of the last event of the run at the time of the request. This can be used to resume streaming from the last event."
    }
  },
  "type": "object",
  "required": [
    "run",
    "candidates"
  ],
  "$defs": {
    "Citation": {
      "description": "A citation for a task output.",
      "properties": {
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Title of the citation.",
          "title": "Title"
        },
        "url": {
          "description": "URL of the citation.",
          "title": "Url",
          "type": "string"
        },
        "excerpts": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Excerpts from the citation supporting the output. Only certain processors provide excerpts.",
          "title": "Excerpts"
        }
      },
      "required": [
        "url"
      ],
      "title": "Citation",
      "type": "object"
    },
    "FieldBasis": {
      "description": "Citations and reasoning supporting one field of a task output.",
      "properties": {
        "field": {
          "description": "Name of the output field.",
          "title": "Field",
          "type": "string"
        },
        "citations": {
          "default": [],
          "description": "List of citations supporting the output field.",
          "items": {
            "$ref": "#/$defs/Citation"
          },
          "title": "Citations",
          "type": "array"
        },
        "reasoning": {
          "description": "Reasoning for the output field.",
          "title": "Reasoning",
          "type": "string"
        },
        "confidence": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Confidence level for the output field. Only certain processors provide confidence levels.",
          "title": "Confidence"
        }
      },
      "required": [
        "field",
        "reasoning"
      ],
      "title": "FieldBasis",
      "type": "object"
    },
    "FindAllCandidate": {
      "properties": {
        "candidate_id": {
          "type": "string",
          "title": "Candidate ID",
          "description": "ID of the candidate."
        },
        "name": {
          "type": "string",
          "title": "Name",
          "description": "Name of the candidate."
        },
        "url": {
          "type": "string",
          "title": "Url",
          "description": "URL that provides context or details of the entity for disambiguation."
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Description",
          "description": "Brief description of the entity that can help answer whether entity satisfies the query."
        },
        "match_status": {
          "type": "string",
          "enum": [
            "generated",
            "matched",
            "unmatched",
            "discarded"
          ],
          "title": "Match Status",
          "description": "Status of the candidate. One of generated, matched, unmatched, discarded."
        },
        "output": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Output",
          "description": "Results of the match condition evaluations for this candidate. This object contains the structured output that determines whether the candidate matches the overall FindAll objective."
        },
        "basis": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/FieldBasis"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Basis",
          "description": "List of FieldBasis objects supporting the output."
        }
      },
      "type": "object",
      "required": [
        "candidate_id",
        "name",
        "url",
        "match_status"
      ],
      "title": "FindAllCandidate",
      "description": "Candidate for a find all run that may end up as a match.\n\nContains all the candidate's metadata and the output of the match conditions.\nA candidate is a match if all match conditions are satisfied."
    },
    "FindAllCandidateMetrics": {
      "properties": {
        "generated_candidates_count": {
          "type": "integer",
          "title": "Generated Candidates Count",
          "description": "Number of candidates that were selected.",
          "default": 0
        },
        "matched_candidates_count": {
          "type": "integer",
          "title": "Matched Candidates Count",
          "description": "Number of candidates that evaluated to matched.",
          "default": 0
        }
      },
      "type": "object",
      "title": "FindAllCandidateMetrics",
      "description": "Metrics object for FindAll run."
    },
    "FindAllRun": {
      "properties": {
        "findall_id": {
          "type": "string",
          "title": "FindAll ID",
          "description": "ID of the FindAll run."
        },
        "status": {
          "$ref": "#/$defs/FindAllRunStatus",
          "description": "Status object for the FindAll run."
        },
        "generator": {
          "type": "string",
          "enum": [
            "base",
            "core",
            "pro",
            "preview"
          ],
          "title": "Generator",
          "description": "Generator for the FindAll run."
        },
        "metadata": {
          "anyOf": [
            {
              "additionalProperties": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "integer"
                  },
                  {
                    "type": "number"
                  },
                  {
                    "type": "boolean"
                  }
                ]
              },
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Metadata",
          "description": "Metadata for the FindAll run."
        },
        "created_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Created At",
          "description": "Timestamp of the creation of the run, in RFC 3339 format."
        },
        "modified_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Modified At",
          "description": "Timestamp of the latest modification to the FindAll run result, in RFC 3339 format."
        }
      },
      "type": "object",
      "required": [
        "findall_id",
        "status",
        "generator"
      ],
      "title": "FindAllRun",
      "description": "FindAll run object with status and metadata."
    },
    "FindAllRunStatus": {
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "queued",
            "action_required",
            "running",
            "completed",
            "failed",
            "cancelling",
            "cancelled"
          ],
          "title": "Status",
          "description": "Status of the FindAll run."
        },
        "is_active": {
          "type": "boolean",
          "title": "Is Active",
          "description": "Whether the FindAll run is active"
        },
        "metrics": {
          "$ref": "#/$defs/FindAllCandidateMetrics",
          "description": "Candidate metrics for the FindAll run."
        },
        "termination_reason": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "low_match_rate",
                "match_limit_met",
                "candidates_exhausted",
                "user_cancelled",
                "error_occurred",
                "timeout",
                "insufficient_funds"
              ]
            },
            {
              "type": "null"
            }
          ],
          "title": "Termination Reason",
          "description": "Reason for termination when FindAll run is in terminal status."
        }
      },
      "type": "object",
      "required": [
        "status",
        "is_active",
        "metrics"
      ],
      "title": "FindAllRunStatus",
      "description": "Status object for FindAll run."
    }
  }
}