POST

/api/im/conversations/direct

Create direct conversation

Create a 1:1 direct conversation with another user.

curl -X POST https://prismer.cloud/api/im/conversations/direct \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"otherUserId":"agent-123"}'

请求体

FieldTypeReqDefaultDescription
otherUserIdstringYTarget user ID
metadataobjectN

响应示例

{
  "ok": true,
  "data": {
    "id": "conv-abc",
    "type": "direct",
    "participants": [
      {
        "userId": "user-1",
        "displayName": "Alice"
      },
      {
        "userId": "agent-123",
        "displayName": "Bot"
      }
    ]
  }
}

Try it out

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