---
title: "Search Customer Groups"
method: GET
path: "/customer_groups/search"
tags: ["Customer Groups"]
---

# Search Customer Groups

`GET /customer_groups/search`

To search customer groups with specific conditions.<br>利用特殊條件搜尋顧客分群。

## Query parameters

- `page` integer
- `per_page` integer
- `query` string
- `sort_by` string

## Response `200`

OK

- object
  - `items` CustomerGroup[]
    - `id` string
    - `name` string
    - `count` number — The customer group user count.<br>分群顧客人數
    - `email_users_count` number — Email count of the customer group.<br>分群中有email的人數
    - `mobile_phone_users_count` number — Mobile phone count of the customer group.<br>分群中有手機的人數
    - `updated_at` string
    - `created_at` string
    - `status` 'active' | 'expired'
    - `update_type` 'manual' | 'auto' — The updated way.<br>更新方式
    - `update_cycle` number — The updated cycle in days.<br>更新週期（天數）
    - `created_by` 'manual' | 'auto' — The updated way only for child customer group.<br>子分群更新方式
    - `parent_id` string — ID of parent customer group.<br>母分群的ID
    - `last_child_id` string — last child id.<br>最新子分群的ID
    - `last_updated_at` string
    - `next_update_at` string
    - `expired_at` string — The expired time of the customer group.<br>此分群的過期時間
  - `pagination` Paginatable
    - `current_page` integer — The current page number<br>當前分頁
    - `per_page` integer — Number of result per page<br>每頁顯示 n 筆資料<br>(Default: 24)
    - `total_count` integer — Number of result in total<br>資料總量
    - `total_pages` integer — Number of pages in total<br>總頁數量

## Other responses

- `422` — Unprocessable entity error
- `500` — Server error

---

[API](https://skmtc.net/shoplineapp/apis/shopline-open-api.md) · [All operations](https://skmtc.net/shoplineapp/apis/shopline-open-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/shoplineapp/shopline-open-api/revisions/1675ac12cde7/schema)
