> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.orderupb2b.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.orderupb2b.com/_mcp/server.

# 查詢後台使用者清單

GET https://api.example.com/v1/internal-users

分頁查詢後台使用者清單。可用 name、email 篩選，皆為大小寫不敏感的子字串比對；用 status 篩帳號狀態，只接受 Active 或 Inactive（完全比對，但大小寫不敏感，帶 active 一樣會命中 Active；這一點與商品、規格的 status 篩選不同，那兩支要求大小寫完全相符）。這支端點沒有 outerSysCode 篩選——要用 outerSysCode 找特定一筆，請改用 GET /v1/internal-users/\{id} 依 id 查詢。page 從 1 起算，pageSize 為 1–100（預設 100），超出範圍一律回 400，不會自動夾限，避免分批掃描時誤判為已經抓完全部資料。

Reference: https://docs.orderupb2b.com/api-reference/internal-users/list-internal-users

## Authentication

- `X-Signature` header (required) — 每個 /v1 請求都必須帶 X-Client-Id、X-Timestamp、X-Nonce 與 X-Signature 四個標頭。X-Signature 是以 client secret 對 canonical string 做 HMAC-SHA256 後的 Base64。canonical string 的組成、可複製的簽章範例與 401 排查步驟，請參閱「驗證與簽章」。

## Request

### Query parameters

- `name` (string, optional) — 依姓名篩選。大小寫不敏感的子字串比對，前後空白會被忽略。
- `email` (string, optional) — 依電子郵件篩選。大小寫不敏感的子字串比對，規則與 name 相同。
- `status` (string, optional) — 依帳號狀態篩選，只接受 Active 或 Inactive。這是完全比對，但大小寫不敏感，前後空白也會被忽略——帶 active 一樣會命中 Active。這一點與商品、規格的 status 篩選不同，那兩支要求大小寫完全相符。
- `Page` (integer, optional) — 頁碼，從 1 起算，省略時預設 1。小於 1 回傳 400 invalid_page；頁碼大到讓內部位移量溢位時同樣回傳 400 invalid_page。
- `PageSize` (integer, optional) — 每頁筆數，範圍 1 至 100，省略時預設 100。超出範圍一律回傳 400 invalid_page_size，不會自動夾限成合法值，避免分批掃描時誤判為已經抓完全部資料。

## Response

### 200

OK

- `data` (list of object, optional, nullable) — 本頁的後台使用者資料，每一筆為一個 InternalUserResponse。
  - `id` (long, optional) — 使用者序號。
  - `account` (string, optional, nullable) — 帳號。
  - `name` (string, optional, nullable) — 姓名。
  - `email` (string, optional, nullable) — 電子郵件。
  - `roleId` (long, optional, nullable) — 目前指派的角色序號。清單與單筆查詢回傳的都是實際的角色序號，不會是 null——沒有角色指派的使用者不會出現在查詢結果中。
  - `roleName` (string, optional, nullable) — 目前指派的角色名稱，與 roleId 對應。
  - `status` (string, optional, nullable) — 帳號狀態，Active（生效）或 Inactive（停用）。
  - `outerSysCode` (string, optional, nullable) — ERP 端的使用者代碼。
- `totalCount` (integer, optional) — 符合篩選條件的後台使用者總數，涵蓋所有頁，不受目前頁碼影響。
- `currentPage` (integer, optional) — 目前頁碼，即請求帶入的 page，從 1 起算。
- `pageSize` (integer, optional) — 目前頁面的筆數上限，即請求帶入的 pageSize。
- `totalPages` (integer, optional) — 總頁數，等於 totalCount 除以 pageSize 後無條件進位；沒有符合的資料時為 0。

## Errors

### 400 Bad Request Error

Bad Request

- `error` (string, optional, nullable) — 錯誤代碼，固定為 snake_case 字串，依代碼判斷失敗原因。

### 401 Unauthorized Error

Unauthorized

- `error` (string, optional, nullable) — 錯誤代碼，固定為 snake_case 字串，依代碼判斷失敗原因。

### 403 Forbidden Error

Forbidden

- `error` (string, optional, nullable) — 錯誤代碼，固定為 snake_case 字串，依代碼判斷失敗原因。

### 500 Internal Server Error

Internal Server Error

- `code` (string, optional, nullable) — 錯誤代碼字串。
- `message` (string, optional, nullable) — 對應的錯誤說明文字。

## Examples

**Response**

```json
{
  "data": [
    {
      "id": 1,
      "account": "string",
      "name": "string",
      "email": "string",
      "roleId": 1,
      "roleName": "string",
      "status": "string",
      "outerSysCode": "string"
    }
  ],
  "totalCount": 1,
  "currentPage": 1,
  "pageSize": 1,
  "totalPages": 1
}
```

**SDK Code**

```python
import requests

url = "https://api.example.com/v1/internal-users"

headers = {"X-Signature": "<apiKey>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.example.com/v1/internal-users';
const options = {method: 'GET', headers: {'X-Signature': '<apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.example.com/v1/internal-users"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("X-Signature", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.example.com/v1/internal-users")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["X-Signature"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.example.com/v1/internal-users")
  .header("X-Signature", "<apiKey>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.example.com/v1/internal-users', [
  'headers' => [
    'X-Signature' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.example.com/v1/internal-users");
var request = new RestRequest(Method.GET);
request.AddHeader("X-Signature", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["X-Signature": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/v1/internal-users")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```