Prompt Versions

Every prompt write or edit creates a new entry in the agent's history. These endpoints let you inspect it — useful for auditing or for restoring earlier versions (by running a POST /prompt with the returned content).

List Prompt Versions

GET https://api.platica.mx/v1/agents/{agentId}/prompt/versions

URL parameters

ParameterTypeDescriptionRequired
agentIdstringUnique identifier of the agent

Query parameters

ParameterTypeDescriptionDefault
limitintegerMaximum number of versions to return (1-200)50

Response

{
  "versions": [
    {
      "id": "8Xdjb0VjgIq35mzmt1wu",
      "operation": "edit",
      "details": "Exact match replacement",
      "owners": ["wnuHhEC1dWgpCYAi3sKsjd81kwW2"],
      "createdAt": "2026-05-28T06:14:21.000Z",
      "updatedAt": "2026-05-28T06:14:21.000Z"
    },
    {
      "id": "id45iLWReNWPfEGkAbFv",
      "operation": "write",
      "details": "Rewrite tras lanzamiento del producto X",
      "owners": ["wnuHhEC1dWgpCYAi3sKsjd81kwW2"],
      "createdAt": "2026-05-28T06:10:01.000Z",
      "updatedAt": "2026-05-28T06:10:01.000Z"
    }
  ]
}

Versions are returned in descending order by createdAt (newest first). The id of the most recent version matches the agent's activePromptId.

Response fields

FieldDescription
idVersion ID (matches activePromptId for the active one)
operationType of operation that produced the version: "create", "write", "edit", or "modify"
detailsDescriptive note about the change
ownersUID of the user or API key that created the version
createdAtCreation date in ISO 8601 format
updatedAtUpdate date in ISO 8601 format

Get a Prompt Version

Returns a specific version, including the full prompt content at that point in time.

GET https://api.platica.mx/v1/agents/{agentId}/prompt/versions/{versionId}

URL parameters

ParameterTypeDescriptionRequired
agentIdstringUnique identifier of the agent
versionIdstringVersion identifier

Response

{
  "id": "id45iLWReNWPfEGkAbFv",
  "prompt": "Eres un asistente de soporte experto en electrónica de consumo...",
  "operation": "write",
  "details": "Rewrite tras lanzamiento del producto X",
  "owners": ["wnuHhEC1dWgpCYAi3sKsjd81kwW2"],
  "createdAt": "2026-05-28T06:10:01.000Z",
  "updatedAt": "2026-05-28T06:10:01.000Z"
}

Unlike the listing, this response includes the prompt field with the full system prompt content as it was in that version.