ms_<prefix>_<secret> 的长期 token。明文 token 仅返回一次,请立即保存。
role_id 可省略,默认使用组织的 API-token 默认角色。所选角色不能授予调用者原本不具备的权限。省略
expires_in_days 表示永不过期;显式值会限制在 1–1825 天。创建 token 需要
api_tokens.manage。
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
curl -X POST http://localhost:5080/api/v1/auth/tokens \
-H "authorization: Bearer $MS_JWT" \
-H 'content-type: application/json' \
-d '{
"name": "collector-production",
"role_id": "<organization-role-id>",
"expires_in_days": 90
}'
{
"id": "<token-id>",
"prefix": "a1b2c3",
"token": "ms_a1b2c3_d4e5f6g7h8i9...",
"role_id": "<organization-role-id>",
"role_key": "viewer",
"role_name": "Viewer",
"expires_at_micros": 1735689600000000,
"created_at_micros": 1727913600000000
}
创建长期 API token。
curl -X POST http://localhost:5080/api/v1/auth/tokens \
-H "authorization: Bearer $MS_JWT" \
-H 'content-type: application/json' \
-d '{
"name": "collector-production",
"role_id": "<organization-role-id>",
"expires_in_days": 90
}'
{
"id": "<token-id>",
"prefix": "a1b2c3",
"token": "ms_a1b2c3_d4e5f6g7h8i9...",
"role_id": "<organization-role-id>",
"role_key": "viewer",
"role_name": "Viewer",
"expires_at_micros": 1735689600000000,
"created_at_micros": 1727913600000000
}
POST /api/v1/auth/tokens
ms_<prefix>_<secret> 的长期 token。明文 token 仅返回一次,请立即保存。
curl -X POST http://localhost:5080/api/v1/auth/tokens \
-H "authorization: Bearer $MS_JWT" \
-H 'content-type: application/json' \
-d '{
"name": "collector-production",
"role_id": "<organization-role-id>",
"expires_in_days": 90
}'
role_id 可省略,默认使用组织的 API-token 默认角色。所选角色不能授予调用者原本不具备的权限。省略
expires_in_days 表示永不过期;显式值会限制在 1–1825 天。创建 token 需要
api_tokens.manage。
{
"id": "<token-id>",
"prefix": "a1b2c3",
"token": "ms_a1b2c3_d4e5f6g7h8i9...",
"role_id": "<organization-role-id>",
"role_key": "viewer",
"role_name": "Viewer",
"expires_at_micros": 1735689600000000,
"created_at_micros": 1727913600000000
}
此页面对您有帮助吗?