Every prompt mutation creates a new version in the history and atomically updates the agent's systemPrompt and activePromptId. This lets you audit changes and restore earlier versions.
Consejo
Calling PATCH /v1/agents/{agentId} with a systemPrompt field also creates a version automatically — the prompt is always versioned.
Get Active Prompt
GET https://api.platica.mx/v1/agents/{agentId}/prompt
URL parameters
Parameter
Type
Description
Required
agentId
string
Unique identifier of the agent
✓
Response
{ "systemPrompt": "Eres un asistente de soporte experto...", "activePromptId": "j8sl3KdQF1IBpRtoSWtR", "lastUpdate": "2026-05-28T06:14:21.000Z"}
Response fields
Field
Description
systemPrompt
Text of the active prompt
activePromptId
ID of the active version in the history
lastUpdate
Last update date in ISO 8601 format
Write Prompt
Overwrites the prompt with content and creates a new entry in the history.
POST https://api.platica.mx/v1/agents/{agentId}/prompt
URL parameters
Parameter
Type
Description
Required
agentId
string
Unique identifier of the agent
✓
Request body
{ "content": "Eres un asistente de soporte para una tienda de electrónica...", "details": "Rewrite tras lanzamiento del producto X"}
Parameter
Type
Description
Required
content
string
Full content of the system prompt
✓
details
string
Descriptive note about the change, stored with the version (≤ 1000 chars)
—
Response
{ "status": "success", "message": "Agent system prompt written successfully", "data": { "activePromptId": "id45iLWReNWPfEGkAbFv", "systemPrompt": "Eres un asistente de soporte...", "contentLength": 4321 }}
Edit Prompt
Replaces a fragment of the current prompt. By default it tries an exact match, then a fuzzy match (with whitespace normalized). If useRegex is true, oldText is interpreted as a regular expression.