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

# 删除角色

> 软删除角色。不会中断进行中的实时会话。已删除角色不能用于创建新会话。

> [accordion] 错误
>
> 错误响应使用相同的 `{code, message, data}` 封装；非零 `code` 表示具体错误。
>
> | 情况 | 错误码 |
> | - | - |
> | 角色不存在、已删除或不属于当前工作区 | `20005 not found` |


## OpenAPI

````yaml cn/streaming-avatar/api-references/openapi.json DELETE /v1/characters/{character_id}
openapi: 3.1.0
info:
  title: Vivix Streaming Avatar API 中文参考
  version: 1.0.0
  description: Streaming Avatar 会话、音色和角色的 REST 接口。
servers:
  - url: https://api.vivix.ai
security:
  - bearerAuth: []
paths:
  /v1/characters/{character_id}:
    delete:
      summary: 删除角色
      description: 软删除角色。不会中断进行中的实时会话。已删除角色不能用于创建新会话。
      operationId: deleteCharacter
      parameters:
        - name: character_id
          in: path
          required: true
          schema:
            type: string
          description: 要删除的角色 ID。
          example: chr_a1b2c3d4e5f6789012345678abcdef01
      responses:
        '200':
          description: 成功
          content:
            application/json:
              schema:
                type: object
                required:
                  - code
                  - message
                  - data
                properties:
                  code:
                    type: integer
                    description: 成功时为 `0`；其他值均为错误码。
                  message:
                    type: string
                    description: '`success`，或英文错误说明。'
                  data:
                    type: object
                    properties:
                      character_id:
                        type: string
                        description: 已删除角色的 ID。
                      status:
                        type: string
                        description: 固定为 `deleted`。
                    required:
                      - character_id
                      - status
              example:
                code: 0
                message: success
                data:
                  character_id: chr_a1b2c3d4e5f6789012345678abcdef01
                  status: deleted
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 你的 Vivix API 密钥。请仅保存在服务端。

````

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