# 注销用户

> 接口应在服务器端调用，不可在前端（小程序、网页、APP等）直接调用，具体可参考[接口调用指南](/doc/oplatform/developers/dev/guide.md)。

接口英文名：unregisterUser

本接口用于多端应用注销用户。

## 1. 调用方式

### HTTPS 调用

```bash
POST https://api.weixin.qq.com/donut/unregisteruser?access_token=ACCESS_TOKEN
```

### 云调用

- 本接口不支持云调用。

### 第三方调用

- 本接口不支持第三方平台调用。

## 2. 请求参数

### 查询参数 `Query String Parameters`

```json
[
  {
    "参数名": "access_token",
    "类型": "string",
    "必填": "是",
    "示例": "ACCESS_TOKEN",
    "说明": "接口调用凭证，可使用 [access_token](getaccesstoken)"
  }
]
```

### 请求体 `Request Payload`

```json
[
  {
    "参数名": "user_id",
    "类型": "string",
    "必填": "是",
    "说明": "多端用户ID，不要从不安全的客户端传入该参数，可在服务端通过[登录凭证校验](code2Verifyinfo)获取。"
  }
]
```

## 3. 返回参数

### 返回体 `Response Payload`

```json
[
  {
    "参数名": "errcode",
    "类型": "number",
    "说明": "错误码"
  },
  {
    "参数名": "errmsg",
    "类型": "string",
    "说明": "错误提示"
  }
]
```

## 4. 注意事项

本接口无特殊注意事项

## 5. 代码示例

请求示例

```json
{
    "user_id": "bbb"
}
```

返回示例

```json
{
    "errcode": 0,
    "errmsg": "ok"
}
```

## 6. 错误码

以下是本接口的错误码列表，其他错误码可参考 [通用错误码](/doc/oplatform/developers/errCode/README.md)；调用接口遇到报错，可使用官方提供的 [API 诊断工具](https://developers.weixin.qq.com/console/devtools/debug?utm_source=api_errcode) 辅助定位和分析问题。

```json
[
  {
    "错误码": "-1",
    "错误描述": "system error"
  },
  {
    "错误码": "40014",
    "错误描述": "invalid access_token"
  },
  {
    "错误码": "10001005",
    "错误描述": "多端应用未接入身份管理"
  },
  {
    "错误码": "10001038",
    "错误描述": "用户不存在"
  }
]
```

## 7. 适用范围

本接口支持「多端应用」账号类型调用。其他账号类型如无特殊说明，均不可调用。
