> ## Documentation Index
> Fetch the complete documentation index at: https://developer.9squid.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Run Selection Criteria

> Validate your loan tape against eligibility rules, fetch results, and inspect exceptions.

<Steps>
  <Step title="Trigger a Selection Criteria Run">
    Pass the `loan_id` (deal ID) to validate. The SC job runs asynchronously — results are available once it completes.

    <CodeGroup>
      ```bash cURL theme={null}
      curl -X POST https://api.9squid.com/v1/api/originator/sc/run \
        -H "Authorization: Bearer <your_token>" \
        -H "Content-Type: application/json" \
        -d '{ "loan_id": "clx1a2b3c4d5e6f7g8h9" }'
      ```

      ```json Response theme={null}
      {
        "success": true,
        "data": {
          "sc_job_id": "clxjob123456"
        }
      }
      ```
    </CodeGroup>
  </Step>

  <Step title="Fetch Results for a Deal">
    Each run creates a new job — results are tracked per `sc_job_id` so you have a full history.

    <CodeGroup>
      ```bash cURL theme={null}
      curl https://api.9squid.com/v1/api/originator/sc/loans/clx1a2b3c4d5e6f7g8h9/results \
        -H "Authorization: Bearer <your_token>"
      ```

      ```json Response theme={null}
      {
        "success": true,
        "data": [
          {
            "sc_job_id": "clxjob123456",
            "run_date": "2026-04-15T10:00:00Z",
            "pass": false,
            "exception_count": 2,
            "results": [
              { "field": "fico_score", "rule": "min_fico_700", "passed": false },
              { "field": "ltv",        "rule": "max_ltv_80",   "passed": true  },
              { "field": "dti",        "rule": "max_dti_45",   "passed": false }
            ]
          }
        ]
      }
      ```
    </CodeGroup>
  </Step>

  <Step title="List All Exceptions">
    View all exception files across all SC runs for your organization.

    <CodeGroup>
      ```bash cURL theme={null}
      curl https://api.9squid.com/v1/api/originator/sc/exceptions \
        -H "Authorization: Bearer <your_token>"
      ```

      ```json Response theme={null}
      {
        "success": true,
        "data": [
          {
            "id": "clxexc789",
            "deal_id": "clx1a2b3c4d5e6f7g8h9",
            "sc_job_id": "clxjob123456",
            "exception_count": 2,
            "created_at": "2026-04-15T10:00:00Z"
          }
        ]
      }
      ```
    </CodeGroup>
  </Step>

  <Step title="Inspect Exception Detail">
    Drill into a specific exception to see the rule, actual value, and threshold that failed.

    After correcting your loan data, re-upload the tape and trigger a fresh SC run with the same `loan_id`.

    <CodeGroup>
      ```bash cURL theme={null}
      curl https://api.9squid.com/v1/api/originator/sc/exceptions/clxexc789 \
        -H "Authorization: Bearer <your_token>"
      ```

      ```json Response theme={null}
      {
        "success": true,
        "data": {
          "id": "clxexc789",
          "loan_data": {},
          "exception_history": [
            {
              "field": "fico_score",
              "rule": "min_fico_700",
              "actual_value": 680,
              "threshold": 700,
              "passed": false
            }
          ]
        }
      }
      ```
    </CodeGroup>
  </Step>
</Steps>
