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

# Scorecards via API

## Scorecards via API

Use the Lendflow API to list and inspect scorecards, run scorecards or scorecard groups against an application, and retrieve selected run results.

## Before you begin

Your integration needs:

* An integration token with access to the application and scorecard endpoints.
* The application ID for the deal.
* The stage ID of the **Scorecards** stage in that application's workflow.
* The scorecard or scorecard-group IDs when you want to run specific templates.

Scorecards must be created and finished in **Builders > Scorecards** before they can be run through the public API.

## API flow

### 1. Find a scorecard

Use [List Scorecards](/api-reference/scorecards/list-scorecards) to retrieve scorecards available to your integration. The operation supports filters such as status, workflow stage, and application ID. Use [Get Scorecard](/api-reference/scorecards/get-scorecard) when you need one scorecard's configuration. Set `include_results` when you need that scorecard's run results in the response.

### 2. Run scorecards

Use the applicable endpoint:

* [Run Scorecards for Application](/api-reference/scorecards/run-scorecards-for-application)
* [Run Scorecard Groups for Application](/api-reference/scorecards/run-scorecard-groups-for-application)

Include the Scorecards `stage_id` in the request. Include `score_card_ids` or `score_card_group_ids` to run specific templates. If you omit the corresponding ID list, Lendflow runs all eligible scorecards or groups available on that stage. A successful run request returns `data.started: true`; results are retrieved separately.

<Note>
  Running a scorecard evaluates information already available on the application. It does not run Data Orchestration or request new provider data.
</Note>

### 3. Retrieve results

Use the applicable operation after the run completes:

* [Get Multiple Scorecard Results](/api-reference/scorecards/get-multiple-scorecard-results)
* [Get Multiple Scorecard Group Results](/api-reference/scorecards/get-multiple-scorecard-group-results)

These operations do not retrieve every result by application ID. For an individual scorecard, send its `scoreCard_id` in the path and the applicable run IDs in the `result_ids` request field. For a scorecard group, send its `scoreCardGroup_id` and the group run IDs in `result_ids`. Each request accepts between 1 and 5,000 result IDs.

Use List Scorecards with `application_id`, or Get Scorecard with `include_results`, to inspect available scorecard runs and collect the IDs you need. A scorecard-group completion webhook can provide the corresponding group run context. The multi-results responses return only the requested runs.

### 4. Handle externally calculated points

The current public OpenAPI specification does not expose an operation for manually submitting points to a **Submit Score** template. Do not build a new integration against the previously documented manual-points operation. Contact your Lendflow representative to confirm the supported workflow for your organization.

## Webhook notifications

Configure [Custom Workflow Webhooks](/lendflow-external/docs/custom-workflows-webhooks) to receive completion notifications:

| Event | Sent when |
| - | - |
| `scorecard.finished` | An individual scorecard run finishes. |
| `scorecard.group_finished` | A scorecard-group run finishes. |

Use the applicable multi-results operation with the template or group ID and the result IDs after receiving the completion event.

## FAQ

<AccordionGroup>
  <Accordion title="What is the stage_id?">
    The `stage_id` is the ID of the **Scorecards** stage in the workflow assigned to the application. It is not the scorecard template ID.
  </Accordion>

  <Accordion title="How do I run every available scorecard?">
    Include the application's Scorecards `stage_id` and omit `score_card_ids`. For groups, omit `score_card_group_ids`.
  </Accordion>

  <Accordion title="Can I create or edit scorecard templates through the public API?">
    No. Create and manage scorecards and scorecard groups in **Builders > Scorecards**. The current public API supports listing and getting scorecards, running scorecards or groups, and retrieving selected results.
  </Accordion>

  <Accordion title="Can I submit manual points through the public API?">
    The current public OpenAPI specification does not expose a manual-points operation. Contact your Lendflow representative before designing a Submit Score integration.
  </Accordion>

  <Accordion title="Can I create a Backtest Report through the public API?">
    No. Create Backtest Reports in **Builders > Scorecards > Backtest Reports** or start one from the **Deals** page.
  </Accordion>
</AccordionGroup>

## Next steps

<Card title="Run Scorecards on a Deal" icon="play" horizontal href="/lendflow-external/docs/how-to-run-a-scorecard-in-a-deal">
  See how dashboard users run scorecards and review results.
</Card>

<Card title="Configure Custom Workflow Webhooks" icon="webhook" horizontal href="/lendflow-external/docs/custom-workflows-webhooks">
  Receive scorecard and scorecard-group completion notifications.
</Card>
