# 使所有群組驗證權杖失效

> 使指定群組的所有群組授權權杖失效。在 AWS 上，資料庫範圍的權杖不會被失效；請透過資料庫端點個別使其失效。
> Canonical HTML: https://tursodb.cn/zh-tw/docs/api-reference/groups/invalidate-tokens/
> Upstream Source (MIT): https://docs.turso.tech/api-reference/groups/invalidate-tokens
> Language: zh-TW

---
<div class="doc-callout doc-callout-info"><div class="doc-callout-title">注意</div><div class="doc-callout-body">

此操作會使群組權杖失效。在 AWS 上，資料庫範圍的權杖不會被失效；請使用資料庫端點個別使它們失效。

</div></div>


```bash cURL
curl -L -X POST 'https://api.turso.tech/v1/organizations/{organizationSlug}/groups/{groupName}/auth/rotate' \
-H 'Authorization: Bearer TOKEN'
```

```ts Node.js
import { createClient } from "@tursodatabase/api";

const turso = createClient({
  org: "...",
  token: "",
});

const response = await turso.groups.invalidateTokens("default");
```


## OpenAPI

````yaml POST /v1/organizations/{organizationSlug}/groups/{groupName}/auth/rotate
openapi: 3.0.1
info:
  title: Turso Platform API
  description: 此處為 API 說明
  license:
    name: MIT
  version: 0.1.0
servers:
  - url: https://api.turso.tech
    description: Turso 的平台 API
security: []
paths:
  /v1/organizations/{organizationSlug}/groups/{groupName}/auth/rotate:
    post:
      summary: 使所有群組驗證權杖失效
      description: >-
        使指定群組的所有群組授權權杖失效。在 AWS 上，資料庫範圍的權杖不會被失效；
        請透過資料庫端點個別使其失效。
      operationId: invalidateGroupTokens
      parameters:
        - $ref: '#/components/parameters/organizationSlug'
        - $ref: '#/components/parameters/groupName'
      responses:
        '200':
          description: 成功回應（無內容）
        '404':
          $ref: '#/components/responses/GroupNotFoundResponse'
components:
  parameters:
    organizationSlug:
      in: path
      name: organizationSlug
      required: true
      schema:
        type: string
      description: 組織或使用者帳號的 slug。
    groupName:
      name: groupName
      in: path
      required: true
      schema:
        type: string
      description: 群組名稱。
  responses:
    GroupNotFoundResponse:
      description: 找不到群組
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                description: 錯誤訊息
                example: group not found

````
