> For the complete documentation index, see [llms.txt](https://doc.keepnetlabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.keepnetlabs.com/api-reference/reseller/companies/list-and-manage-company-groups.md).

# List and manage company groups

As a Reseller you can list, search, export, create, and update company groups and their participants. **Participants** = the companies that belong to the group (company `resourceId` list). Company groups let you share training content, notification templates, and custom roles across multiple customer companies. Use a credential with Client Role = **Reseller**.

***

## GET /api/company-groups

> Retrieves all company groups. No request body. **Test it:** Authorize with Client ID/Secret, then Send.

{% openapi src="/files/YqgEnchxXuSVklhH9GGT" path="/api/company-groups" method="get" expanded="true" %}
[keepnet-api-spec.json](https://3453589210-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LMcQ_WCXOrHv3r05ae5%2Fuploads%2Fgit-blob-31c738c1a6bb3d2911bd3730c780d6ad7fa6bbad%2Fkeepnet-api-spec.json?alt=media)
{% endopenapi %}

***

## POST /api/company-groups/search

> Searches company groups with pagination and sorting. **Test it:** Authorize with Client ID/Secret, then Send — request body is pre-filled (`pageNumber: 1`, `pageSize: 10`, `orderBy: CreateTime`).

{% openapi src="/files/YqgEnchxXuSVklhH9GGT" path="/api/company-groups/search" method="post" expanded="true" %}
[keepnet-api-spec.json](https://3453589210-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LMcQ_WCXOrHv3r05ae5%2Fuploads%2Fgit-blob-31c738c1a6bb3d2911bd3730c780d6ad7fa6bbad%2Fkeepnet-api-spec.json?alt=media)
{% endopenapi %}

***

## POST /api/company-groups/search/export

> Exports the list of company groups to CSV or Excel. **Test it:** Authorize with Client ID/Secret, then Send — request body is pre-filled (minimal pagination + `exportType: Csv`).

{% openapi src="/files/YqgEnchxXuSVklhH9GGT" path="/api/company-groups/search/export" method="post" expanded="true" %}
[keepnet-api-spec.json](https://3453589210-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LMcQ_WCXOrHv3r05ae5%2Fuploads%2Fgit-blob-31c738c1a6bb3d2911bd3730c780d6ad7fa6bbad%2Fkeepnet-api-spec.json?alt=media)
{% endopenapi %}

***

## GET /api/company-groups/{resourceId}

> Retrieves a single company group by ID. Replace `{resourceId}` with the group resource ID from search or list.

{% openapi src="/files/YqgEnchxXuSVklhH9GGT" path="/api/company-groups/{resourceId}" method="get" expanded="true" %}
[keepnet-api-spec.json](https://3453589210-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LMcQ_WCXOrHv3r05ae5%2Fuploads%2Fgit-blob-31c738c1a6bb3d2911bd3730c780d6ad7fa6bbad%2Fkeepnet-api-spec.json?alt=media)
{% endopenapi %}

***

## POST /api/company-groups

> Creates a new company group. Send `name` and optionally `companyResourceIdArray` (company IDs to add as participants). **Test it:** Endpoints → **CompanyGroup** — use dummy name (e.g. `"Demo Group"`) and placeholder IDs (H8d).

{% openapi src="/files/YqgEnchxXuSVklhH9GGT" path="/api/company-groups" method="post" expanded="true" %}
[keepnet-api-spec.json](https://3453589210-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LMcQ_WCXOrHv3r05ae5%2Fuploads%2Fgit-blob-31c738c1a6bb3d2911bd3730c780d6ad7fa6bbad%2Fkeepnet-api-spec.json?alt=media)
{% endopenapi %}

***

## PUT /api/company-groups/{resourceId}

> Updates a company group (e.g. name). Replace `{resourceId}` with the group ID.

{% openapi src="/files/YqgEnchxXuSVklhH9GGT" path="/api/company-groups/{resourceId}" method="put" expanded="true" %}
[keepnet-api-spec.json](https://3453589210-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LMcQ_WCXOrHv3r05ae5%2Fuploads%2Fgit-blob-31c738c1a6bb3d2911bd3730c780d6ad7fa6bbad%2Fkeepnet-api-spec.json?alt=media)
{% endopenapi %}

***

## PUT /api/company-groups/{resourceId}/participants

> Sets the participants (companies) in a company group. Replace `{resourceId}` with the **group** ID; request body = array of company resource IDs. Replaces the full member list. Participants = the companies in the group (see Terminology in DOCUMENTATION-RULES).

{% openapi src="/files/YqgEnchxXuSVklhH9GGT" path="/api/company-groups/{resourceId}/participants" method="put" expanded="true" %}
[keepnet-api-spec.json](https://3453589210-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LMcQ_WCXOrHv3r05ae5%2Fuploads%2Fgit-blob-31c738c1a6bb3d2911bd3730c780d6ad7fa6bbad%2Fkeepnet-api-spec.json?alt=media)
{% endopenapi %}

***

## Common errors

* **403 Forbidden** — Credential is not Reseller. Set Client Role = **Reseller** in **Company → Company Settings → REST API**. [Roles and permissions →](/next-generation-product/platform/company/system-users/user-roles.md)
* **401 Unauthorized** — Missing or invalid token. Request a new token via `POST /connect/token`.
* **400 Bad Request** — Invalid request body. For search/export use minimal body: `pageNumber`, `pageSize`, `orderBy`, `ascending`, `filter`.

**Related:** [Scope API requests to a customer →](/api-reference/reseller/companies/scope-api-requests-to-customer.md). [List companies with license details →](/api-reference/reseller/companies/list-companies-with-license-details.md). [Create a company →](/api-reference/reseller/companies/onboard-new-customer.md) (add new company to a group).

{% hint style="info" %}
**Platform UI:** Manage company groups in **Company → Company Groups**. [Company groups →](/next-generation-product/platform/company/companies/company-groups.md)
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://doc.keepnetlabs.com/api-reference/reseller/companies/list-and-manage-company-groups.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
