# 更新设备

使用该接口在设备管理中修改一台设备的设备归属、设备状态等信息

## 请求

基本 | &nbsp;
---|---
HTTP URL | https://open.feishu.cn/open-apis/security_and_compliance/v2/device_records/:device_record_id
HTTP Method | PUT
接口频率限制 | [10 次/秒](https://open.feishu.cn/document/ukTMukTMukTM/uUzN04SN3QjL1cDN)
支持的应用类型 | Custom App、Store App
权限要求<br>**调用该 API 所需的权限。开启其中任意一项权限即可调用** | 新增、更新、删除设备(security_and_compliance:device_record:write)

### 请求头

名称 | 类型 | 必填 | 描述
---|---|---|---
Authorization | string | 是 | `tenant_access_token`<br>**值格式**："Bearer `access_token`"<br>**示例值**："Bearer t-7f1bcd13fc57d46bac21793a18e560"<br>[了解更多：如何选择与获取 access token](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-choose-which-type-of-token-to-use)
Content-Type | string | 是 | **固定值**："application/json; charset=utf-8"

### 路径参数

名称 | 类型 | 描述
---|---|---
device_record_id | string | 设备认证编码<br>**示例值**："7089353870308032531"

### 查询参数

名称 | 类型 | 必填 | 描述
---|---|---|---
version | string | 是 | 版本号<br>**示例值**：0

### 请求体

名称 | 类型 | 必填 | 描述
---|---|---|---
device_ownership | int | 是 | 设备归属<br>**示例值**：0<br>**可选值有**：<br>- 0：未知设备<br>- 1：个人设备<br>- 2：企业设备
device_status | int | 是 | 可信状态<br>**示例值**：0<br>**可选值有**：<br>- 0：未知状态<br>- 1：信任设备<br>- 2：非信任设备

### 请求体示例
```json
{
    "device_ownership": 0,
    "device_status": 0
}
```

## 响应

### 响应体

名称 | 类型 | 描述
---|---|---
code | int | 错误码，非 0 表示失败
msg | string | 错误描述
data | \- | \-

### 响应体示例
```json
{
    "code": 0,
    "msg": "success",
    "data": {}
}
```

### 错误码

HTTP状态码 | 错误码 | 描述 | 排查建议
---|---|---|---
500 | 1780001 | Internal server error. | 内部接口处理失败。若无法解决请寻求客服帮助
400 | 1780101 | Request param error. | 检查参数是否正确
400 | 1780102 | The API is in beta testing. Please contact customer support to request beta access. | 联系服务提供方排查
400 | 1785008 | The device is not found. Please check the parameter device_record_id and version. | 检查参数中设备编码和版本号是否存在

