API Documentation
Scoped instruction management across project/subject/chat with priority composition and integration-bound template variable support.
Overview
System prompts are managed instructions automatically injected into LLM requests. They support scoping at project, subject, or chat level.
projectsubjectsubject_id.chatchat_id.Prompts are layered: project → subject → chat. Multiple prompts are concatenated.
Dynamic Context is supported with {{var_name}} tokens via thetemplate object. Integration resolution is controlled byMNX_PROMPT_TEMPLATE_RENDER_ENABLED.
See Integrations for connector setup, test/sync flows, and Request Trace observability fields.
/api/v1/promptsList all system prompts for your project.
prompts:readcurl "https://www.mnexium.com/api/v1/prompts" \
-H "x-mnexium-key: $MNX_KEY"{
"prompts": [
{
"id": "sp_abc123",
"name": "Default Assistant",
"prompt_text": "You are a helpful assistant.",
"scope": "project",
"is_default": true,
"priority": 100
}
]
}/api/v1/promptsCreate a new system prompt. Set is_default: true for auto-injection.
prompts:writenamerequiredprompt_textrequiredscopescope_idis_defaultprioritytemplate{{var}} tokens.curl -X POST "https://www.mnexium.com/api/v1/prompts" \
-H "x-mnexium-key: $MNX_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Default Assistant",
"prompt_text": "You are a helpful assistant for {{customer_name}}.",
"scope": "project",
"is_default": true,
"template": {
"enabled": true,
"variables": {
"customer_name": {
"source": "integration",
"integration_id": "int_crm",
"key": "customer_name",
"live_fetch": false,
"default": "customer"
}
}
}
}'{
"ok": true,
"prompt": {
"id": "sp_abc123",
"name": "Default Assistant",
"scope": "project"
}
}/api/v1/prompts/:idUpdate an existing system prompt. Only provided fields are updated.
prompts:writeidrequirednameprompt_textis_defaultis_activeprioritytemplatecurl -X PATCH "https://www.mnexium.com/api/v1/prompts/sp_abc123" \
-H "x-mnexium-key: $MNX_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt_text": "You are a friendly assistant.",
"is_default": true
}'{
"ok": true,
"id": "sp_abc123",
"updated": true
}/api/v1/prompts/:idSoft-delete a system prompt. The prompt is deactivated but retained for audit purposes.
prompts:deleteidrequiredcurl -X DELETE "https://www.mnexium.com/api/v1/prompts/sp_abc123" \
-H "x-mnexium-key: $MNX_KEY"{
"ok": true,
"id": "sp_abc123",
"deleted": true
}/api/v1/prompts/resolvePreview which prompts will be injected for a given context.
prompts:readsubject_idchat_idcombinedcurl -G "https://www.mnexium.com/api/v1/prompts/resolve" \
-H "x-mnexium-key: $MNX_KEY" \
--data-urlencode "subject_id=user_123" \
--data-urlencode "combined=true"// When combined=true:
{
"prompt_text": "You are a helpful assistant.\n\nThis user prefers concise responses.",
"has_prompt": true
}
// When combined=false (default):
{
"prompts": [
{ "id": "sp_abc123", "scope": "project", ... },
{ "id": "sp_def456", "scope": "subject", ... }
],
"count": 2
}Using system_prompt and memory_policy in Requests
Control system prompt injection and memory extraction policy via mnx.system_prompt and mnx.memory_policy:
// Auto-resolve based on context (default)
"mnx": { "subject_id": "user_123" }
// Skip system prompt injection
"mnx": { "system_prompt": false }
// Use a specific prompt by ID
"mnx": { "system_prompt": "sp_sales_assistant" }
// Use a specific memory policy by ID
"mnx": { "memory_policy": "mp_support_assistant" }
// Disable memory policy for this request
"mnx": { "memory_policy": false }