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

# Add criteria groups to collection

> Link criteria groups in a collection.

Link criteria groups in a collection.

Linking a group also includes its current cases in the collection.

## Headers

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

## Path parameters

<ParamField path="id" type="string" required>
  Collection UUID.
</ParamField>

## Body parameters

<ParamField body="groupIds" type="array" required>
  One to 200 unique criteria-group UUIDs for this agent.
</ParamField>

## Response

Returns `success: true`.

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://api-prod.usefini.com/v2/test-suite/folders/00000000-0000-4000-8000-000000000004/groups/public' \
    --header 'Authorization: Bearer fini_your_api_key' \
    --header 'Content-Type: application/json' \
    --data '{
    "groupIds": [
      "00000000-0000-4000-8000-000000000003"
    ]
  }'
  ```

  ```javascript Node.js theme={null}
  const body = {
    "groupIds": [
      "00000000-0000-4000-8000-000000000003"
    ]
  };

  const response = await fetch("https://api-prod.usefini.com/v2/test-suite/folders/00000000-0000-4000-8000-000000000004/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('''
  {
    "groupIds": [
      "00000000-0000-4000-8000-000000000003"
    ]
  }
  ''')

  response = requests.request(
      "POST",
      "https://api-prod.usefini.com/v2/test-suite/folders/00000000-0000-4000-8000-000000000004/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}
  {"success": true}
  ```
</ResponseExample>


## Related topics

- [Overview](/en/api-reference/test-suite.md)
- [Remove criteria groups from collection](/en/api-reference/remove-test-suite-collection-groups.md)
- [Add cases to criteria group](/en/api-reference/add-test-suite-group-cases.md)


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