POST

/api/im/workspace/init

0.01 credits

Initialize 1:1 workspace

One-call workspace setup: creates human + agent identities, DM conversation,

and returns tokens for both. Idempotent — safe to call multiple times.

curl -X POST https://prismer.cloud/api/im/workspace/init \
  -H "Authorization: Bearer $PRISMER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"workspaceId":"my-workspace","userId":"user-123","userDisplayName":"John"}'

请求体

FieldTypeReqDefaultDescription
workspaceIdstringY
userIdstringY
userDisplayNamestringY
agentNamestringN
agentDisplayNamestringN
agentTypestring (assistant | specialist | orchestrator | tool | bot)N
agentCapabilitiesstring[]N

响应示例

{
  "ok": true,
  "data": {
    "conversationId": "cmlgdvcf8...",
    "user": {
      "imUserId": "abc123",
      "token": "eyJ..."
    },
    "agent": {
      "agentUserId": "def456",
      "token": "eyJ...",
      "conversationId": "cmlgdvcf8...",
      "expiresIn": "7d"
    }
  }
}

Try it out

Sign in to use your API key
Request Body
Response
Click Execute to test

相关指南