# Doanh nghiệp

## Thông tin chi tiết

<mark style="color:blue;">`GET`</mark> `[URL]/api/tenant/detail`

Thông tin chi tiết doanh nghiệp

#### Headers

| Name          | Type   | Description         |
| ------------- | ------ | ------------------- |
| Authorization | string | Bearer Access Token |

{% tabs %}
{% tab title="200 Thông tin chi tiết doanh nghiệp" %}

```
{
    "status_code": 9999,
    "instance_id": "stg",
    "instance_name": "DESKTOP-1OB3SFM",
    "payload": {
        "full_name": "Omi Team",
        "email": "support@omicrm.com",
        "description": "Nâng cao trải nghiệm khách hàng, lấy sự hài lòng của khách hàng làm tiêu chí phấn đấu của doanh nghiệp",
        "enabled": true, //Đang hoạt động hoặc ngưng hoạt động
        "domain": "omiteam", // Tên miền truy cập OMI
        "domain_fusion": "omiteam", // Tên miền tổng đài
        "domain_expire": 1584606068154, // Ngày hết hạn domain
        "effective_date": 1583396482840, // Ngày kích hoạt
        "expire_date": 1614936981790, // Ngày hết hạn
        "phone": "0844441900", // SĐT chủ doanh nghiệp
        "status": "activated", // Trạng thái: Đã kích hoạt / Chưa kích hoạt
        "paid_type": "prepaid", // Hình thức thanh toán : prepaid : Trả trước, postpaid : Trả sau
        "nation": "vn", // Quốc gia
        "currency": "VND", // Tiền tệ
        "language": "vi", // Ngôn ngữ
        "balance": 3007855, // Số dư tài khoản
        "public_numbers": [
            {
                "number": "842877788056", // Số hotline
                "provider": "itel", // Nhà mạng
                "expire_date": 1602731734809, //Ngày hết hạn số
                "status": "active" // Tình trạng số
            }
        ],
        "service_package": {
            "code_name": "trial", // Mã gói
            "service_name": "Trial", // Tên gói
            "staff_num": 5, // Số lượng nhân viên
            "customer_num": 100, // Số lượng khách hàng
            "expiry_date": 1606300035002 // Ngày gói hết hạn
        }
    },
    "key_enabled": false
}
```

{% endtab %}
{% endtabs %}

## Danh sách phân quyền

<mark style="color:green;">`POST`</mark> `[URL]/api/tenant/role/list`

Danh sách phân quyền nhân viên của doanh nghiệp

#### Headers

| Name          | Type   | Description         |
| ------------- | ------ | ------------------- |
| Authorization | string | Bearer Access Token |

#### Request Params

| Name | Type    | Description                                   |
| ---- | ------- | --------------------------------------------- |
| page | Integer | Số thứ tự trang                               |
| size | Integer | Số lượng data lấy về trong 1 trang. Từ 1 - 50 |

#### Request Body

| Name    | Type   | Description      |
| ------- | ------ | ---------------- |
| keyword | string | Keyword tìm kiếm |

{% tabs %}
{% tab title="200 Danh sách phân quyền" %}

```
{
    "instance_id": "stg",
    "payload": {
        "items": [
            {
                "_id": "6732dc3d827b8d5c308bcc7c", // id phân quyền
                "name": "Sale", // tên phân quyền
                "name_unsigned": "sale",
                "description": ""
            },
            ...
        ],
        "page_number": 1,
        "page_size": 10,
        "total_items": 5,
        "total_pages": 1,
        "has_next": false,
        "next_page": 1,
        "has_previous": false,
        "previous_page": 1,
        "extension": null
    },
    "instance_version": "1.2.164",
    "key_enabled": false,
    "status_code": 9999
}
```

{% endtab %}
{% endtabs %}

## Danh sách gói dịch vụ

<mark style="color:blue;">`GET`</mark> `[URL]/api/tenant/service_package_tenant_v2/user/list`

Danh sách các gói dịch vụ cá nhân chưa được gán cho nhân viên

#### Headers

| Name          | Type   | Description         |
| ------------- | ------ | ------------------- |
| Authorization | string | Bearer Access Token |

{% tabs %}
{% tab title="200 Danh sách gói dịch vụ" %}

```
{
    "instance_id": "stg",
    "payload": [
        {
            "service_name": "OMNI Channel AI", // Tên gói
            "service_code": "omni_channel_ai", // Mã gói
            "ids": [ // danh sách id các gói khả dụng
                "67a4789e19a6ca32cbc4ca08",
                "67a4789e19a6ca32cbc4ca0c",
                "67a4789e19a6ca32cbc4ca0e",
                "67a4789e19a6ca32cbc4ca10",
                "67a4789e19a6ca32cbc4ca12"
            ],
            "agency": "omicrm.com",
            "total": 5 // tổng gói khả dụng
        },
        ...
    ],
    "instance_version": "1.2.164",
    "key_enabled": false,
    "status_code": 9999
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: 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:

```
GET https://api.omicall.com/omicall-api/tenant.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
