Turso Cloud API 參考 介面資源 API 權杖
列出組織 API 權杖
傳回範圍限定於此組織的 API 權杖(包括組織範圍與群組範圍)。不受限制的權杖不會在此傳回——請透過 [`GET /v1/auth/api-tokens`](/api-reference/tokens/list) 管理這些權杖。
GET
https://api.turso.tech/v1/organizations/{organizationSlug}/api-tokens 授權規則與撤銷端點對稱:
- 管理員與擁有者會看到範圍限定於該組織的每個權杖,並在
owner欄位附上簽發該權杖的使用者。 - 成員與檢視者只會看到自己簽發的權杖。
這與 GitHub 組織設定中使用的個人存取權杖模型相同:管理員可取得完整的簽發歸屬清單;其他所有人則只能看到自己的存取權杖。
注意
使用此端點可列舉作用於單一組織的權杖(包括組織範圍與群組範圍)。管理員與擁有者會看到組織內的每個權杖,並附上簽發該權杖的使用者;成員與檢視者則只會看到自己的權杖。若要列出呼叫者所屬每個組織的權杖,請改用 GET /v1/auth/api-tokens。
curl -L 'https://api.turso.tech/v1/organizations/{organizationSlug}/api-tokens' \
-H 'Authorization: Bearer TOKEN'
OpenAPI
openapi: 3.0.1
info:
title: Turso Platform API
description: API description here
license:
name: MIT
version: 0.1.0
servers:
- url: https://api.turso.tech
description: Turso's Platform API
security: []
paths:
/v1/organizations/{organizationSlug}/api-tokens:
get:
summary: List Organization API Tokens
description: >-
Returns the API tokens scoped to this organization (both
organization-scoped and group-scoped). Unrestricted tokens are not
returned here — manage those via [`GET
/v1/auth/api-tokens`](/api-reference/tokens/list).
Authorization is symmetric with the revoke endpoint:
- **Admins and owners** see every token scoped to the organization, with
the minting user attached in the `owner` field.
- **Members and viewers** see only tokens they minted themselves.
This mirrors the personal-access-token model used in GitHub organization
settings: admins get the full attribution list; everyone else sees their
own access.
operationId: listOrganizationAPITokens
parameters:
- $ref: '#/components/parameters/organizationSlug'
responses:
'200':
description: Successful response
content:
application/json:
schema:
type: object
properties:
tokens:
type: array
items:
type: object
properties:
name:
type: string
description: The token name.
example: ci-bot
id:
type: string
description: The token ID. Pass this to the revoke endpoint.
example: clGFZ4STEe6fljpFzIum8A
organization:
type: string
description: >-
The organization slug. Always equal to the path
parameter for tokens returned here.
example: my-org
group:
type: string
description: >-
The group name. Present only for group-scoped
tokens.
example: default
scopes:
type: array
items:
type: string
description: >-
The expanded scope list. Present only for tokens
with scopes.
example:
- db:create
- db:configure
- db:mint-token
owner:
type: object
properties:
username:
type: string
example: alice
email:
type: string
example: alice@example.com
description: >-
The user who minted the token. Returned to admins
and owners so they can see who provisioned each
token.
created_at:
type: string
description: The date the token was created.
example: '2026-05-21'
components:
parameters:
organizationSlug:
in: path
name: organizationSlug
required: true
schema:
type: string
description: The slug of the organization or user account.
同步自官方 Turso 文件倉庫 (
tursodatabase/turso-docs
· MIT 開源授權)
檢視官方原文 ↗