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

# 移除一个 API 令牌

> DELETE /console/token/{key}/

永久吊销一个 Management API 密钥。与[创建令牌](/zh/api-reference/management-api/tokens/create)一样，此端点位于**常规**的 Scanova API 主机（`qcg-api.scanova.io`）上，使用您正常的仪表盘 OAuth 访问令牌进行身份验证——而不是您要删除的那个密钥。

## 请求

```
DELETE https://qcg-api.scanova.io/console/token/{key}/
Authorization: Bearer <your_oauth_access_token>
```

<ParamField path="key" type="string" required>
  令牌创建时返回的完整密钥值（不是数字 ID）。
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X DELETE "https://qcg-api.scanova.io/console/token/401f7ac837da42b97f613d789819ff93537bee6a/" \
    -H "Authorization: Bearer <your_oauth_access_token>"
  ```
</RequestExample>

<ResponseExample>
  ```text 204 No Content theme={null}
  ```
</ResponseExample>

## 行为

* 成功移除会返回带有空响应体的 `204 No Content`。
* 一旦被删除，该密钥会立即停止在数据主机上进行身份验证——任何正在进行中或后续使用该密钥的请求都会得到 `401`。
* 您只能删除自己拥有的密钥（或者，对于共享用户而言，该共享用户自己创建的密钥）。

<Note>
  删除操作同样会使用一个 `environment` 值重新检查套餐配额，如果您没有传入该值则默认为 `sandbox`——与[创建令牌](/zh/api-reference/management-api/tokens/create#listing-existing-tokens)页面所述的规则相同。这在实际使用中很少造成影响，因为授予 Management API 访问权限的套餐通常会跨所有 environment 授予该权限，但如果您在删除某个 live environment 密钥时遇到意外的 `401`，请显式传入 `?environment=live`。
</Note>

<Warning>
  不存在"禁用"或"暂停"状态——移除操作是即时且永久的。如果您只是需要暂时停止使用某个密钥，请不要删除它；创建一个新密钥并停止使用旧密钥，或者在删除之前与使用该密钥的集成方协调好。
</Warning>

## 相关内容

* [Management API 概览](/zh/api-reference/management-api/overview) —— 本端点所属的双主机身份验证架构。
* [创建一个 API 令牌](/zh/api-reference/management-api/tokens/create) —— 生成一个替代密钥，并了解本端点共用的列表/配额规则。
* [用量统计](/zh/api-reference/management-api/tokens/usage-stats) —— 在决定是否移除某个密钥之前查看其用量。


## OpenAPI

````yaml api-reference/openapi/management-api.json DELETE /console/token/{key}/
openapi: 3.1.0
info:
  title: Scanova Management API (v2)
  description: >-
    The complete Scanova Management API — every endpoint available at
    management.scanova.io (QR codes, folders, tags, leads, forms, analytics,
    plans, shared users & roles), plus the token-creation and usage-stats
    endpoints used to authenticate against it. Every path and request/response
    shape below was verified live against a real API key and the actual running
    backend (Phase 7, 2026-08-16) — not guessed from reading urls.py alone.
  version: 2.0.0
servers:
  - url: https://management.scanova.io
    description: Management API — QR/folder/tag/lead/form/analytics/plans endpoints
security:
  - apiKeyAuth: []
paths:
  /console/token/{key}/:
    delete:
      summary: Remove an API token
      operationId: removeApiToken
      parameters:
        - name: key
          in: path
          required: true
          schema:
            type: string
      responses:
        '204':
          description: Token removed
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Send your Management API key as the raw value of the Authorization
        header — no "Bearer " or "Token " prefix, and no other characters.
        Example: `Authorization: 401f7ac837da42b97f613d789819ff93537bee6a`. A
        header containing more than one space-separated part is rejected
        outright. Requests also require the request's Host header to be the
        management API host (e.g. management.scanova.io) — the same key sent to
        the regular API host will not authenticate.

````