# 更新角色

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /chatroom/v2/room_role/update:
    post:
      summary: 更新角色
      deprecated: false
      description: ''
      tags:
        - HTTP接口/房间角色接口
      parameters:
        - name: client_type
          in: query
          description: 声明请求黑盒语音
          required: true
          example: heybox_chat
          schema:
            type: string
            default: heybox_chat
        - name: x_client_type
          in: query
          description: 声明客户端类型
          required: true
          example: web
          schema:
            type: string
            default: web
        - name: os_type
          in: query
          description: 声明客户端类型
          required: true
          example: web
          schema:
            type: string
            default: web
        - name: x_os_type
          in: query
          description: 声明客户端是bot
          required: true
          example: bot
          schema:
            type: string
            default: bot
        - name: x_app
          in: query
          description: 声明请求黑盒语音
          required: true
          example: heybox_chat
          schema:
            type: string
            default: heybox_chat
        - name: chat_os_type
          in: query
          description: 声明客户端是bot
          required: true
          example: bot
          schema:
            type: string
            default: bot
        - name: chat_version
          in: query
          description: 客户端版本号,不同版本返回的结果可能有区别
          required: true
          example: 1.30.0
          schema:
            type: string
            default: 1.30.0
        - name: Content-Type
          in: header
          description: ''
          required: true
          example: application/json;charset=UTF-8
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: string
                  description: 角色id
                name:
                  type: string
                  description: 角色名称。
                icon:
                  type: string
                  description: 角色icon的url
                color_list:
                  type: array
                  items:
                    type: integer
                  description: 渐变色的颜色数组
                room_id:
                  type: string
                  description: 房间 ID
                permissions:
                  type: string
                  description: 权限值
                type:
                  type: integer
                  description: 创建的新角色仅为0
                color:
                  type: integer
                  description: 颜色值，在界面展示中用于区分不同角色。
                hoist:
                  type: integer
                  description: 是否将该角色成员在右侧和普通成员区分显示,1是区分0是不区分
                nonce:
                  type: string
                  description: 随机值,防止重复请求
                position:
                  type: integer
                  description: 角色位置排序
              required:
                - id
                - name
                - icon
                - color_list
                - room_id
                - permissions
                - type
                - color
                - hoist
                - nonce
                - position
              x-apifox-orders:
                - id
                - name
                - icon
                - color_list
                - room_id
                - permissions
                - type
                - color
                - hoist
                - nonce
                - position
              x-apifox-refs: {}
              x-apifox-ignore-properties: []
            example:
              color: 15158588
              icon: >-
                https://imgheybox.max-c.com/dev/avatar/2024/10/14/2597c1318c14b26c45732d6177ffc2b6.jpeg
              name: 测试管理员
              type: 0
              hoist: 1
              permissions: '1'
              heybox_ids: []
              room_id: '3690041195409809408'
              department_id: '3690041195409809408'
              nonce: undefined
              id: '3690041195495620610'
              position: 324567
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  msg:
                    type: string
                  result:
                    type: object
                    properties:
                      role:
                        $ref: >-
                          #/components/schemas/%E8%A7%92%E8%89%B2%E8%AF%A6%E6%83%85
                    required:
                      - role
                    x-apifox-orders:
                      - role
                    x-apifox-ignore-properties: []
                  status:
                    type: string
                required:
                  - msg
                  - result
                  - status
                x-apifox-orders:
                  - msg
                  - result
                  - status
                x-apifox-ignore-properties: []
              example:
                msg: ''
                result:
                  role:
                    name: 新权限组
                    icon: >-
                      https://imgheybox.max-c.com/dev/avatar/2024/10/09/c94d349733b7c66a75f5f1f4d9ea0857.jpeg
                    color_list:
                      - 6238893
                      - 9714234
                    id: '3687695177638674432'
                    department_id: '3230476736336502784'
                    room_id: '3230476736336502784'
                    permissions: '2'
                    type: 0
                    color: 0
                    position: 266
                    del_tag: 1
                    hoist: 1
                    mentionable: 0
                    creator: '8829926'
                    create_time: 1728442496
                status: ok
          headers: {}
          x-apifox-name: 成功
      security:
        - apikey-header-token: []
      x-apifox-folder: HTTP接口/房间角色接口
      x-apifox-status: developing
      x-run-in-apifox: https://app.apifox.com/web/project/4856361/apis/api-220893910-run
components:
  schemas:
    角色详情:
      type: object
      properties:
        name:
          type: string
          description: 角色名称。
        icon:
          type: string
          description: 角色icon的url
        color_list:
          type: array
          items:
            type: integer
          description: 渐变色的颜色数组
        id:
          type: string
          description: 角色的唯一标识 ID。
        department_id:
          type: string
          description: 所属部门的 ID。目前已经弃用
        room_id:
          type: string
          description: 房间 ID，与部门 ID 相同
        permissions:
          type: string
          description: 权限值
        type:
          type: integer
          description: 类型标识，用于区分不同类型的角色
        color:
          type: integer
          description: 颜色值，在界面展示中用于区分不同角色。
        position:
          type: integer
          description: 角色排序
        del_tag:
          type: integer
          description: 删除标记 1是没有被删除 ,0是已经被删除
        hoist:
          type: integer
          description: 是否将该角色成员在右侧和普通成员区分显示,1是区分0是不区分
        mentionable:
          type: integer
          description: 可提及标记，可能表示该角色在某些场景下是否可被@
        creator:
          type: string
          description: 创建者标识，0 的话则为房间创建者
        create_time:
          type: integer
          description: 创建时间戳,旧数据为0
      required:
        - name
        - icon
        - color_list
        - id
        - department_id
        - room_id
        - permissions
        - type
        - color
        - position
        - del_tag
        - hoist
        - mentionable
        - creator
        - create_time
      x-apifox-orders:
        - name
        - icon
        - color_list
        - id
        - department_id
        - room_id
        - permissions
        - type
        - color
        - position
        - del_tag
        - hoist
        - mentionable
        - creator
        - create_time
      description: '  角色详情'
      x-apifox-ignore-properties: []
      x-apifox-folder: ''
  securitySchemes:
    token:
      type: apikey
      in: header
      name: token
      token: ODYzNzY0NDM7MTc1NTc1OTk1NzYyODYzNjQ0NzsxNTU0MDM2NTkxNzk2OTM1OTY5
    apikey-header-token:
      type: apiKey
      in: header
      name: token
servers:
  - url: http://prod-cn.your-api-server.com
    description: 正式环境
security:
  - apikey-header-token: []

```
