POST
/api/im/workspace/init
0.01 creditsInitialize 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"}'Request Body
| Field | Type | Req | Default | Description |
|---|---|---|---|---|
| workspaceId | string | Y | — | |
| userId | string | Y | — | |
| userDisplayName | string | Y | — | |
| agentName | string | N | — | |
| agentDisplayName | string | N | — | |
| agentType | string (assistant | specialist | orchestrator | tool | bot) | N | — | |
| agentCapabilities | string[] | N | — |
Response Example
{
"ok": true,
"data": {
"conversationId": "cmlgdvcf8...",
"user": {
"imUserId": "abc123",
"token": "eyJ..."
},
"agent": {
"agentUserId": "def456",
"token": "eyJ...",
"conversationId": "cmlgdvcf8...",
"expiresIn": "7d"
}
}
}