> For the complete documentation index, see [llms.txt](https://docs.caresoft.vn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.caresoft.vn/danh-muc/restful-api-cua-caresoft/bo-phan.md).

# Bộ phận

Bộ phận trên CareSoft là đối tượng gom nhóm các chuyên viên về 1 nhóm. Tương đương mô hình 1 phòng ban trong mỗi doanh nghiệp. Có trưởng nhóm (Supper)  và các chuyên viên (Agent)&#x20;

Các API khác khi sử dụng bộ phận sẽ dùng `{{group_id}}`  là ID của bộ phận để thực hiện giao thức

<figure><img src="/files/TcvucADE2sYOI2IW9sn0" alt=""><figcaption><p>Màn hình cấu hình bộ phận trên giao diện CareSoft</p></figcaption></figure>

{% hint style="info" %}
**Lưu ý:** Bộ phận có thể cấu hình thay đổi tên gọi hoặc thêm mới từ giao diện. Cần đặt tiến trình đồng bộ mỗi ngày để đảm bảo thông tin chính xác&#x20;
{% endhint %}

## Lấy danh sách bộ phận

## Danh sách bộ phận được cấu hình trên hệ thống

<mark style="color:blue;">`GET`</mark> `{{domain}}/api/v1/groups`

#### Headers

| Name | Type   | Description                                                           |
| ---- | ------ | --------------------------------------------------------------------- |
| \*\* | String | [Thông tin xác thực chung ](/thong-tin-chung.md#phuong-thuc-xac-thuc) |

{% tabs %}
{% tab title="200: OK " %}
{% tabs %}
{% tab title="Mẫu trả về" %}

```json
{
    "code": "ok",
    "groups": [
        {
            "group_id": 12153,
            "group_name": "Default Group",
            "created_at": "2020-10-01 02:48:15"
        },
        {
            "group_id": 12945,
            "group_name": "Kinh doanh",
            "created_at": "2021-10-27 14:55:31"
        },        
        {
            "group_id": 14181,
            "group_name": "Chăm sóc khách hàng",
            "created_at": "2023-03-21 09:33:23"
        }
    ]
}
```

{% endtab %}

{% tab title="Cấu trúc thông tin" %}

*Chi tiết mảng thông tin groups*
{% endtab %}
{% endtabs %}
{% endtab %}

{% tab title="404: Not Found " %}

{% endtab %}

{% tab title="500: Internal Server Error " %}

{% endtab %}
{% endtabs %}

<table><thead><tr><th width="133" data-type="number">STT</th><th width="181">Tên trường</th><th>Ghi chú</th></tr></thead><tbody><tr><td>1</td><td>group_id</td><td>ID bộ phận</td></tr><tr><td>2</td><td>group_name</td><td>Tên bộ phận</td></tr><tr><td>3</td><td>created_at</td><td>Ngày tạo</td></tr></tbody></table>

<table><thead><tr><th width="132" data-type="number">STT</th><th width="158">Tên trường</th><th>Kiểu</th><th>Ghi chú</th></tr></thead><tbody><tr><td>1</td><td>groups</td><td>Array</td><td>Mảng dữ liệu bộ phận</td></tr><tr><td>2</td><td>code</td><td>String</td><td>Trạng thái (OK, NOK)</td></tr></tbody></table>


---

# 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://docs.caresoft.vn/danh-muc/restful-api-cua-caresoft/bo-phan.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.
