MngAddAIPromptTemplate¶
POST ai/prompt
Creates a template — the text the module fills with event fields before asking the model. The brand comes from the session.
Placeholders are written as {{field}}. Which fields exist for an event is listed by
MngGetAIWorkflowEvents in variables.
Access Control¶
Allowed: admin. global: true is accepted from a super administrator only.
Request¶
POST request
POST https://{broker_domain}/ai/prompt
Authorization: <JWT_TOKEN>
Content-Type: application/json
{
"name": "margin-notice",
"type": "notification",
"content": "Account {{login}}: margin level {{margin_level}}%. Explain to the client what to do."
}
{
"command": "MngAddAIPromptTemplate",
"extID": "1",
"data": { "name": "margin-notice", "type": "notification", "content": "Account {{login}}…" }
}
const template = await platform.MngAddAIPromptTemplate({ name, type: 'notification', content });
Parameters¶
| Parameter | Type | Description |
|---|---|---|
name |
string | Required, up to 128 characters |
type |
enum | notification, summary, classify, system |
content |
string | Required, 1 to 20 000 characters |
language |
string | Optional, up to 8 characters |
enabled |
bool | Default true |
global |
bool | Super administrator only: shared by all brands |
Response Data¶
The created template with id, brand, name, type, content, language, enabled
and timestamps.
Errors¶
| Code | Error | Description |
|---|---|---|
400 |
AI_INVALID_DATA |
A template with this name exists, or type is unknown |
403 |
AI_ACCESS_DENIED |
Not an administrator, or global without super administrator rights |