# listUsers · GET /users

<div class="cb-api" id="bkmrk-%E5%88%97%E5%87%BA%E7%94%A8%E6%88%B7-get-%2Fapi%2Fv1%2Fuse"># 列出用户

<div class="cb-api-endpoint"> <span class="cb-api-method cb-api-method--get">GET</span> <code>&#47;api&#47;v1&#47;users</code> </div>operationId: <code>listUsers</code> · 分组: Users · 鉴权: Header <code>X&#45;Demo&#45;Key</code>

演示用 GET：带 query 分页与搜索。响应来自文档示例（真源 OpenAPI）；本页不嵌入第三方调试器。侧栏/导航/深浅色一律沿用主题。

## Query 参数

<table class="cb-api-table"> <thead> <tr><th>名称</th><th>位置</th><th>类型</th><th>必填</th><th>说明</th></tr> </thead> <tbody> <tr> <td><code>page</code></td> <td>query</td> <td><span class="cb-api-type">integer</span></td> <td>否</td> <td>页码，默认 <code>1</code>，最小 <code>1</code></td> </tr> <tr> <td><code>q</code></td> <td>query</td> <td><span class="cb-api-type">string</span></td> <td>否</td> <td>搜索关键字</td> </tr> <tr> <td><code>token</code></td> <td>header</td> <td><span class="cb-api-type">string</span></td> <td><span class="cb-api-required">必填</span></td> <td>演示必填微标（浅底方章甲案）</td> </tr> </tbody> </table>

## 请求示例

<div class="cb-api-example"> <span class="cb-api-example__label">curl（静态生成；本页无试调表单）</span>

```
curl -sS 'https://api.example.com/api/v1/users?page=1&q=demo' \
  -H 'X-Demo-Key: YOUR_KEY'
```

 </div><div class="cb-api-example"> <span class="cb-api-example__label">fetch</span>

```
fetch('https://api.example.com/api/v1/users?page=1&q=demo', {
  headers: { 'X-Demo-Key': 'YOUR_KEY' }
}).then(r => r.json())
```

 </div>## 响应

### <span class="cb-api-status">200</span> 成功

<div class="cb-api-example">

```
{
  "args": { "page": "1", "q": "demo" },
  "url": "https://api.example.com/api/v1/users?page=1&q=demo"
}
```

 </div>### <span class="cb-api-status cb-api-status--err">400</span> 参数错误

页码非法等。

</div><div class="cb-api" id="bkmrk-%E5%88%9B%E5%BB%BA%E7%94%A8%E6%88%B7-post-%2Fapi%2Fv1%2Fus"># 创建用户

<div class="cb-api-endpoint"> <span class="cb-api-method cb-api-method--post">POST</span> <code>&#47;api&#47;v1&#47;users</code> </div>operationId: <code>createUser</code> · 分组: Users

POST 徽章 stub：跟阅读壳同安静度。

## 参数

<table class="cb-api-table"> <thead> <tr><th>名称</th><th>位置</th><th>类型</th><th>必填</th><th>说明</th></tr> </thead> <tbody> <tr> <td><code>name</code></td> <td>body</td> <td><span class="cb-api-type">string</span></td> <td><span class="cb-api-required">必填</span></td> <td>用户名</td> </tr> </tbody> </table>

<div class="cb-api-example"> <span class="cb-api-example__label">curl</span>

```
curl -sS -X POST 'https://api.example.com/api/v1/users' \
  -H 'Content-Type: application/json' \
  -H 'X-Demo-Key: YOUR_KEY' \
  -d '{"name":"demo"}'
```

 </div></div><div class="cb-api" id="bkmrk-%E5%88%A0%E9%99%A4%E7%94%A8%E6%88%B7-delete-%2Fapi%2Fv1%2F"># 删除用户

<div class="cb-api-endpoint"> <span class="cb-api-method cb-api-method--delete">DELETE</span> <code>&#47;api&#47;v1&#47;users&#47;&#123;id&#125;</code> </div>operationId: <code>deleteUser</code> · 分组: Users

DELETE 左边条 muted red（甲案）。

<div class="cb-api-example"> <span class="cb-api-example__label">curl</span>

```
curl -sS -X DELETE 'https://api.example.com/api/v1/users/42' \
  -H 'X-Demo-Key: YOUR_KEY'
```

 </div></div>