API 参考 / api-tokens

项目 API Token 列表

GET /api/v1/projects/{projectId}/api-tokens · listAPITokens

列出当前用户在该项目的 API Token;具备 manage_project_settings 的项目管理员可看本项目全部 token。 仅返回 prefix 与元数据,永不回显明文。PAT 不可调用本端点。

本接口要求浏览器会话。Bearer API Token 无法调用——Token 的生命周期管理必须在网页端完成。

参数

projectId(必填)
string

响应字段 · 200

items(必填)
APIToken[]
items[].id(必填)
string
items[].userId(必填)
string
items[].projectId(必填)
string
items[].name(必填)
string
items[].tokenPrefix(必填)
string
items[].scopes(必填)
string[]
items[].expiresAt
string
items[].lastUsedAt
string
items[].revokedAt
string
items[].createdAt(必填)
string

错误

请求示例(curl)

curl -X GET "https://你的项目.workflow.games/api/v1/projects/{projectId}/api-tokens" \
  -H "Authorization: Bearer wfp_…"

响应示例

HTTP/1.1 200
{
  "items": [
    {
      "id": "018f3c2e-0000-7000-8000-000000000000",
      "userId": "018f3c2e-0000-7000-8000-000000000000",
      "projectId": "018f3c2e-0000-7000-8000-000000000000",
      "name": "示例标题",
      "tokenPrefix": "示例文本",
      "scopes": [
        "read_only"
      ],
      "createdAt": "示例文本"
    }
  ]
}

合同真值:OpenAPI 3.1(0.1.0)。

相关:Agent 接入指南 · 使用指南 · API 参考索引

Workflow 正在加载…