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

# Preview run readiness

> Check selected cases for missing criteria before starting a run.

Check selected cases for missing criteria before starting a run.

The key needs read scope despite the POST method. This route does not queue execution. It checks case selection and criteria readiness; accepted draft-version fields are not validated or used here. Validate draft choices when starting the run.

## Headers

<ParamField header="Authorization" type="string" required>
  Bearer token containing your workspace API key. The key needs `read` scope.
</ParamField>

## Body parameters

<ParamField body="botId" type="string" required>
  Agent UUID. The agent must belong to the workspace.
</ParamField>

<ParamField body="caseIds" type="array">
  Up to 200 case UUIDs. Omit to select cases through the other selectors.
</ParamField>

<ParamField body="folderIds" type="array">
  Up to 200 collection UUIDs. Their direct and group-linked cases are included.
</ParamField>

<ParamField body="criteriaGroupId" type="string">
  Run only this group's shared criteria. Cannot be combined with nonempty `folderIds`.
</ParamField>

<ParamField body="collectionId" type="string">
  Collection UUID for selection/origin. Every selected case must belong to it. A group must be linked to that collection.
</ParamField>

## Response

Returns `total`, `readyCaseIds` and `incompleteCases`. Cases without effective criteria appear in `incompleteCases`.

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://api-prod.usefini.com/v2/test-suite/runs/preview/public' \
    --header 'Authorization: Bearer fini_your_api_key' \
    --header 'Content-Type: application/json' \
    --data '{
    "botId": "00000000-0000-4000-8000-000000000001",
    "caseIds": [
      "00000000-0000-4000-8000-000000000002",
      "00000000-0000-4000-8000-000000000027"
    ]
  }'
  ```

  ```javascript Node.js theme={null}
  const body = {
    "botId": "00000000-0000-4000-8000-000000000001",
    "caseIds": [
      "00000000-0000-4000-8000-000000000002",
      "00000000-0000-4000-8000-000000000027"
    ]
  };

  const response = await fetch("https://api-prod.usefini.com/v2/test-suite/runs/preview/public", {
    method: "POST",
    headers: {
      Authorization: "Bearer fini_your_api_key",
      "Content-Type": "application/json",
    },
    body: JSON.stringify(body),
  });
  if (!response.ok) throw new Error(await response.text());
  const result = await response.json();
  ```

  ```python Python theme={null}
  import requests
  import json

  body = json.loads('''
  {
    "botId": "00000000-0000-4000-8000-000000000001",
    "caseIds": [
      "00000000-0000-4000-8000-000000000002",
      "00000000-0000-4000-8000-000000000027"
    ]
  }
  ''')

  response = requests.request(
      "POST",
      "https://api-prod.usefini.com/v2/test-suite/runs/preview/public",
      headers={"Authorization": "Bearer fini_your_api_key"},
      json=body,
  )
  response.raise_for_status()
  result = response.json()
  ```
</RequestExample>

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "total": 2,
    "readyCaseIds": ["00000000-0000-4000-8000-000000000002"],
    "incompleteCases": [{"id": "00000000-0000-4000-8000-000000000027", "name": "Unfinished scenario"}]
  }
  ```
</ResponseExample>


## Related topics

- [Overview](/en/api-reference/test-suite.md)
- [Run rule test path from config](/en/api-reference/run-rule-test-path-config.md)
- [Preview rule test paths](/en/api-reference/preview-rule-test-paths.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.