{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/popp/json-schema/popp-list-workflow-analysis-application-history-response-schema.json",
  "title": "ListWorkflowAnalysisApplicationHistoryResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/popp-workflows-api-openapi.yml#/components/schemas/ListWorkflowAnalysisApplicationHistoryResponse",
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "description": "Scores, oldest first.",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Identifier of the history entry."
          },
          "trigger": {
            "type": "string",
            "description": "`SCORED`: the first score. `RESCORED`: a re-score that became the effective score. `RESCORED_AFTER_ACTED_ON`: a re-score after the workflow acted, kept as history only. `RESCORE_FAILED`: a re-score that produced no score. The application keeps its score, and this entry is never the effective score.",
            "enum": [
              "SCORED",
              "RESCORED",
              "RESCORED_AFTER_ACTED_ON",
              "RESCORE_FAILED"
            ]
          },
          "workflowVersionId": {
            "type": "string",
            "description": "The workflow version whose requirements were scored."
          },
          "workflowVersionNumber": {
            "type": "integer",
            "description": "That version's number."
          },
          "workflowNodeId": {
            "type": "string",
            "description": "The analysis node's id in that version."
          },
          "workflowNodeLabel": {
            "type": [
              "string",
              "null"
            ],
            "description": "The analysis node's label in that version."
          },
          "workflowRunId": {
            "type": [
              "string",
              "null"
            ],
            "description": "The run whose score this is, when a run produced it."
          },
          "totalScoreScaled": {
            "type": [
              "number",
              "null"
            ],
            "description": "The score, from 0 to 1. Null when no score was produced.",
            "minimum": 0,
            "maximum": 1
          },
          "isAllRequirementsMet": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether every mandatory requirement was met."
          },
          "analysisErrorCode": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why no score was produced, when none was. `DOCUMENT_TOO_LARGE`: the CV's text is too long to score. `ANALYSIS_INPUT_UNAVAILABLE`: there was no CV text and no screening answer to score. `ANALYSIS_FAILED`: scoring failed on Popp's side. More values may be added, so handle a value you don't recognize."
          },
          "requirementOutcomes": {
            "type": "array",
            "description": "Each requirement outcome, with the requirement as it was worded and weighted.",
            "items": {
              "type": "object",
              "properties": {
                "requirementId": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Identifier of the requirement the outcome was scored against."
                },
                "slug": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "The requirement's slug, fixed once published."
                },
                "text": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "The requirement as it was worded when this outcome was scored."
                },
                "weight": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "description": "The requirement's scoring weight when this outcome was scored."
                },
                "isMandatory": {
                  "type": [
                    "boolean",
                    "null"
                  ],
                  "description": "Whether the requirement was mandatory when this outcome was scored."
                },
                "isMet": {
                  "type": "boolean",
                  "description": "Whether the application met the requirement."
                },
                "evidence": {
                  "type": "string",
                  "description": "The evidence for the outcome, from the CV or screening answers."
                },
                "scoredAt": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "When the outcome was scored.",
                  "format": "date-time"
                }
              }
            }
          },
          "screeningAnswers": {
            "type": "array",
            "description": "The screening answers this score used.",
            "items": {
              "type": "object",
              "properties": {
                "atsQuestionId": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "The question's id in the ATS."
                },
                "question": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "The question text."
                },
                "questionIndex": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "description": "The question's position in the application form."
                },
                "type": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "The question type."
                },
                "category": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "The question category."
                },
                "isRequired": {
                  "type": [
                    "boolean",
                    "null"
                  ],
                  "description": "Whether the question was required."
                },
                "isAnswered": {
                  "type": "boolean",
                  "description": "Whether the candidate answered it."
                },
                "answerText": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "A text answer."
                },
                "answerBoolean": {
                  "type": [
                    "boolean",
                    "null"
                  ],
                  "description": "A yes/no answer."
                },
                "answerNumber": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "description": "A numeric answer."
                },
                "answerDate": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "A date answer.",
                  "format": "date"
                },
                "selectedOptions": {
                  "type": "array",
                  "description": "The options the candidate selected.",
                  "items": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                }
              }
            }
          },
          "createdAt": {
            "type": "string",
            "description": "When the score was produced.",
            "format": "date-time"
          }
        }
      }
    },
    "nextToken": {
      "type": [
        "string",
        "null"
      ],
      "description": "Pass as `nextToken` to fetch the next page. Null on the last page."
    }
  }
}