> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stmlink.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> 对外开放的服务端接口有两组前缀，都用同一套鉴权：`/server/v1/...`（SRTC 与 SMeeting 的主接口）和 `/stm/srvapi/v1/...`（SMeeting 的用户体系，服务端极简对接会用到）。鉴权是 app_id + nonce + timestamp + signature 四个请求头，用 app_key 做 HMAC-SHA256 签名，只能从业务方自己的后端调用。除这两组前缀外的接口均为内部接口，不要建议客户调用。 Public server APIs use two path prefixes with the same authentication: `/server/v1/...` (the main APIs of both SRTC and SMeeting) and `/stm/srvapi/v1/...` (the SMeeting user system, used by server-side low-code integration). Authenticate with four request headers, app_id + nonce + timestamp + signature, where signature is HMAC-SHA256 keyed with app_key; call these APIs only from the customer's own backend. Any other path is internal: never suggest calling it.
> app_key 是服务端密钥，绝不能出现在客户端代码、前端配置或移动 App 里。客户端加入频道用的 token 必须由业务方后端签发后下发（SRTC 走 `/server/v1/channel/grant`，SMeeting 走 `/stm/srvapi/v1/member/grant`）。 app_key is a server-side secret and must never appear in client code, frontend config, or a mobile app. The token a client uses to join must be issued by the customer's backend and passed down to the client (SRTC: `/server/v1/channel/grant`; SMeeting: `/stm/srvapi/v1/member/grant`).
> SRTC 与 SMeeting 是上下两层不同的产品，术语不通用：SRTC 是音视频底座，说「频道 channel」「加入 / 退出」；SMeeting 建在 SRTC 之上，说「房间 room」「会议 meeting」「进入 / 退出」。回答时按用户所在的层用对应术语，不要把「房间」「会议」安到 SRTC 的接口上，也不要用「频道」「加入 / 离开」描述 SMeeting 的概念（接口标识符原样保留）。 SRTC and SMeeting are two separate layers with different terminology. SRTC is the audio/video foundation: it has channels, and users join and leave a channel. SMeeting is built on top of SRTC: it has rooms and meetings, and members enter and exit a meeting. Answer in the terms of the layer the user is working with: never apply "room" or "meeting" to SRTC APIs, and never describe SMeeting concepts in prose with "channel", "join", or "leave" (API identifiers such as `force_join` keep their literal names).
> 同一能力在各端 SDK 里的包名、类名、方法名并不相同。写示例代码时请使用文档中该端自己的 API，不要把一个端的写法套到另一个端上。苹果平台每个产品都有两套 SDK（Swift 原生与 Objective-C），两套 API 不能混用。 Package, class, and method names differ between platform SDKs for the same capability. In sample code, use the API documented for that platform; never carry one platform's code over to another. On Apple platforms each product ships two SDKs (native Swift and Objective-C) whose APIs must not be mixed.

# 用户同步

> 把业务系统的用户同步进我们部署的会议用户体系，以及换免登录 token、查在线状态、删除用户；服务端极简对接与通讯录场景使用，接口前缀为 /stm/srvapi/v1

## 批量同步用户

`POST /stm/srvapi/v1/member/sync`

鉴权：需要（见[概览](https://docs.stmlink.com/zh/meeting/server-api/overview.md)）

把你系统里的用户批量推过来，供会议客户端的通讯录、按人员列表挑人入会使用。
只用「换免登录 token」进会的话不需要先同步：那个接口带上昵称时会现场建人。

单次最多 1000 条。按 user\_id 认人：库里没有就新建，已有就更新——全量推、增量推都行。
已有用户的 nickname、real\_name、department 每次都以本次传的为准（department 不传会被清空），
avatar、mobile、password\_hash / salt、camera\_disabled / share\_disabled 不传则保持原值。

同一应用同一时刻只允许一个同步在跑，并发调用会收到「频率过快 请稍候」，等上一批返回后再推下一批。
某一条写库失败不影响其它条，结果按 user\_id 分进 success / fail 两张表。

**请求参数**

请求体是一个 **JSON 数组**，下面是每个元素的字段。

**user\_id** `string` *required*

用户ID，即你系统里的用户唯一标识（最大长度 100）

**nickname** `string` *required*

会中显示的名字（最大长度 100）
示例：`张三`

**real\_name** `string`

真实姓名，留空取 nickname（最大长度 100）

**avatar** `string`

留空表示不改，不会清掉已有头像（最大长度 300）

**mobile** `string`

手机号。纯展示用，不参与认人——认人只认 user\_id。 留空表示不改，不会清掉已有值（最大长度 100）

**password\_hash** `string`

只有用户还要用账号密码登录会议页时才传：sha256(密码 + salt) 的小写十六进制， 与 salt 成对传；不传表示不改（最大长度 100）

**salt** `string`

计算 password\_hash 用的盐，可为空（最大长度 100）

**department** `string`

组织名称，平铺的字符串而非层级（最大长度 100）
示例：`招标一部`

**camera\_disabled** `boolean`

禁止开摄像头

**share\_disabled** `boolean`

禁止共享（屏幕与白板）

请求示例：

```json theme={null}
[
  {
    "avatar": "",
    "camera_disabled": false,
    "department": "招标一部",
    "mobile": "",
    "nickname": "张三",
    "password_hash": "",
    "real_name": "",
    "salt": "",
    "share_disabled": false,
    "user_id": ""
  }
]
```

**响应参数**

**success** `object`

成功的用户，键与值都是你传的 user\_id

**fail** `object`

失败的用户，键是 user\_id，值是失败原因

响应示例：

```json theme={null}
{
  "code": 0,
  "data": {
    "fail": {},
    "success": {}
  }
}
```

***

## 换免登录 token

`POST /stm/srvapi/v1/member/grant`

鉴权：需要（见[概览](https://docs.stmlink.com/zh/meeting/server-api/overview.md)）

用户点「进入会议」时实时调用，换一个免登录 token，拼进会议页地址即可免登录进会。
data 直接就是 token 字符串。

带上 nickname 等资料时，用户不存在就现场建、已存在就顺带更新，所以不必先调「批量同步用户」，
每次把最新的昵称、头像带上即可。只传 user\_id 而这个人从没同步过时会报错——没有昵称，
建出来在会中没有名字。

**请求参数**

**user\_id** `string` *required*

用户ID，同 member/sync 的 user\_id（最大长度 100）

**nickname** `string`

会中昵称（最大长度 100）

**real\_name** `string`

真实姓名，留空取 nickname（最大长度 100）

**avatar** `string`

头像地址，留空表示不改（最大长度 300）

**mobile** `string`

手机号。纯展示用，不参与认人——认人只认 user\_id。留空表示不改（最大长度 100）

**camera\_disabled** `boolean`

禁止开摄像头

**share\_disabled** `boolean`

禁止共享（屏幕与白板）

请求示例：

```json theme={null}
{
  "avatar": "",
  "camera_disabled": false,
  "mobile": "",
  "nickname": "",
  "real_name": "",
  "share_disabled": false,
  "user_id": ""
}
```

**响应参数**

**data** `string`

返回数据

响应示例：

```json theme={null}
{
  "code": 0,
  "data": ""
}
```

***

## 查询用户与在线状态

`POST /stm/srvapi/v1/member/info`

鉴权：需要（见[概览](https://docs.stmlink.com/zh/meeting/server-api/overview.md)）

按 user\_id 批量查询已同步的用户资料，返回里带 is\_online，可用来在你的界面上显示在线状态。
不存在的 user\_id 不会出现在返回里。

**请求参数**

**user\_ids** `array\<string\>`

用户ID列表，即同步时传的 user\_id

请求示例：

```json theme={null}
{
  "user_ids": [
    ""
  ]
}
```

**响应参数**

**user\_id** `string`

用户ID

**mobile** `string`

手机号

**nickname** `string`

昵称

**real\_name** `string`

真实姓名

**avatar** `string`

头像

**is\_online** `boolean`

是否在线

**created\_at** `integer`

创建时间，Unix 秒

**camera\_disabled** `boolean`

禁止开摄像头

**share\_disabled** `boolean`

禁止共享

响应示例：

```json theme={null}
{
  "code": 0,
  "data": [
    {
      "avatar": "",
      "camera_disabled": false,
      "created_at": 0,
      "is_online": false,
      "mobile": "",
      "nickname": "",
      "real_name": "",
      "share_disabled": false,
      "user_id": ""
    }
  ]
}
```

***

## 删除用户

`POST /stm/srvapi/v1/member/remove`

鉴权：需要（见[概览](https://docs.stmlink.com/zh/meeting/server-api/overview.md)）

按 user\_id 批量删除用户（如员工离职）。删除后该用户无法再换 token 进会；
不存在的 user\_id 直接忽略。

**请求参数**

**user\_ids** `array\<string\>`

用户ID列表，即同步时传的 user\_id

请求示例：

```json theme={null}
{
  "user_ids": [
    ""
  ]
}
```

**响应参数**

`data` 为 null

响应示例：

```json theme={null}
{
  "code": 0,
  "data": null
}
```

***


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.