> ## 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.

# Create criteria group

> Create shared criteria and optionally link cases or capture conversations.

Create shared criteria and optionally link cases or capture conversations.

The combined number of conversations and existing cases cannot exceed 50. Existing local criteria are preserved. Total effective criteria per linked case cannot exceed 50.

## Headers

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

## Body parameters

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

<ParamField body="name" type="string" required>
  Nonblank name, up to 200 characters.
</ParamField>

<ParamField body="criteria" type="array" required>
  One to 50 criterion definitions. See [Criterion definitions](/en/api-reference/test-suite#criterion-definitions).
</ParamField>

<ParamField body="conversationIds" type="array">
  Up to 50 unique Inbox conversation UUIDs to capture as cases.
</ParamField>

<ParamField body="caseIds" type="array">
  Up to 50 unique existing case UUIDs to link.
</ParamField>

<ParamField body="collectionId" type="string">
  Collection UUID to link this group to.
</ParamField>

## Response

Returns the group, linked cases and its current `impactToken`.

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://api-prod.usefini.com/v2/test-suite/criteria-groups/public' \
    --header 'Authorization: Bearer fini_your_api_key' \
    --header 'Content-Type: application/json' \
    --data '{
    "botId": "00000000-0000-4000-8000-000000000001",
    "name": "Refund checks",
    "criteria": [
      {
        "name": "No handoff",
        "type": "deterministic",
        "condition": {
          "scope": "SCALAR",
          "predicate": {
            "left": {
              "path": "escalated",
              "dataType": "boolean"
            },
            "operator": "==",
            "right": {
              "value": false
            }
          }
        },
        "blocking": true
      }
    ],
    "caseIds": [
      "00000000-0000-4000-8000-000000000002"
    ]
  }'
  ```

  ```javascript Node.js theme={null}
  const body = {
    "botId": "00000000-0000-4000-8000-000000000001",
    "name": "Refund checks",
    "criteria": [
      {
        "name": "No handoff",
        "type": "deterministic",
        "condition": {
          "scope": "SCALAR",
          "predicate": {
            "left": {
              "path": "escalated",
              "dataType": "boolean"
            },
            "operator": "==",
            "right": {
              "value": false
            }
          }
        },
        "blocking": true
      }
    ],
    "caseIds": [
      "00000000-0000-4000-8000-000000000002"
    ]
  };

  const response = await fetch("https://api-prod.usefini.com/v2/test-suite/criteria-groups/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",
    "name": "Refund checks",
    "criteria": [
      {
        "name": "No handoff",
        "type": "deterministic",
        "condition": {
          "scope": "SCALAR",
          "predicate": {
            "left": {
              "path": "escalated",
              "dataType": "boolean"
            },
            "operator": "==",
            "right": {
              "value": false
            }
          }
        },
        "blocking": true
      }
    ],
    "caseIds": [
      "00000000-0000-4000-8000-000000000002"
    ]
  }
  ''')

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

<ResponseExample>
  ```json 201 Created theme={null}
  {
    "id": "00000000-0000-4000-8000-000000000003",
    "companyId": "00000000-0000-4000-8000-000000000011",
    "botId": "00000000-0000-4000-8000-000000000001",
    "name": "Refund checks",
    "criteria": [
      {
        "id": "00000000-0000-4000-8000-000000000012",
        "companyId": "00000000-0000-4000-8000-000000000011",
        "defaultCriterionId": null,
        "name": "No handoff",
        "type": "deterministic",
        "condition": {
          "scope": "SCALAR",
          "predicate": {"left": {"path": "escalated", "dataType": "boolean"}, "operator": "==", "right": {"value": false}}
        },
        "blocking": true,
        "judgePrompt": null,
        "passPrompt": null,
        "failPrompt": null,
        "isActive": true,
        "createdAt": "2026-10-12T10:00:00.000Z",
        "updatedAt": "2026-10-12T10:00:00.000Z"
      }
    ],
    "revision": 1,
    "createdAt": "2026-10-12T10:00:00.000Z",
    "updatedAt": "2026-10-12T10:00:00.000Z",
    "caseCount": 1,
    "linkedCases": [{"id": "00000000-0000-4000-8000-000000000002", "name": "Refund policy", "sourceInteractionId": null}],
    "impactToken": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
  }
  ```
</ResponseExample>


## Related topics

- [Overview](/en/api-reference/test-suite.md)
- [List criteria groups](/en/api-reference/list-test-suite-criteria-groups.md)
- [Get criteria group](/en/api-reference/get-test-suite-criteria-group.md)


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