Skip to content

AIChatCreateConversation

POST ai/chat/conversation

Creates a conversation. It has to exist before the first question: AIChatSendMessage requires a conversationId.

agentId is optional and usually should be omitted — the module picks the default agent of the brand for this audience, so the interface does not need to know that agents exist.

Access Control

Allowed: client, manager, admin. A conversation belongs to the session that created it: a manager sees their own, a client sees the ones of the current account.

Request

POST request
POST https://{broker_domain}/ai/chat/conversation
Authorization: <JWT_TOKEN>
Content-Type: application/json

{
  "title": "Margin call on 2000067",
  "accountLogin": 2000067
}
{
  "command": "AIChatCreateConversation",
  "extID": "1",
  "data": { "title": "Margin call on 2000067", "accountLogin": 2000067 }
}
const conversation = await platform.AIChatCreateConversation({ title: 'Margin call on 2000067' });

Parameters

Parameter Type Description
agentId int Optional. A specific agent; must be allowed for this audience
title string Optional, up to 255 characters
accountLogin int Trading account the conversation is about. Required for a client session of an account owner (type: 9); optional context for a manager

Response Data

{
  "id": "cnv_8f3a…",
  "brand": "Ion",
  "actorType": 1,
  "actorId": 501,
  "accountLogin": 0,
  "agentId": 1,
  "title": "Margin call on 2000067",
  "summary": "",
  "archived": false,
  "createdAt": "2026-09-17 10:12:04",
  "updatedAt": "2026-09-17 10:12:04"
}

Errors

Code Error Description
400 AI_INVALID_DATA A client session of an account owner did not pass accountLogin
403 AI_ACCESS_DENIED The session type may not use the assistant
404 AI_AGENT_NOT_FOUND No agent is configured for this brand and audience, or the requested agentId is not visible
409 AI_AGENT_DISABLED The requested agent exists but is not allowed in this kind of chat