---
title: "生成 Agent Token"
method: POST
path: "/workspace/{workspaceId}/agents/{agentId}/token"
tags: ["Workspace"]
---

# 生成 Agent Token

`POST /workspace/{workspaceId}/agents/{agentId}/token`

为 Agent 生成新的 JWT Token

## Path parameters

- `workspaceId` string, required
- `agentId` string, required

## Response `200`

成功

- AgentTokenResponse
  - `ok` boolean
  - `data` object
    - `token` string — JWT Token
    - `agentUserId` string — Agent 用户 ID
    - `conversationId` string — 绑定的会话 ID
    - `expiresIn` string

## Other responses

- `401` — 未认证或 Token 无效
- `404` — 资源不存在

---

[API](https://skmtc.net/prismer-ai/apis/prismer-im-server-api.md) · [All operations](https://skmtc.net/prismer-ai/apis/prismer-im-server-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/prismer-ai/prismer-im-server-api/revisions/b27b5d973513/schema)
