Update Agent

Update an existing agent. Only the fields provided in the request are modified.

PATCH https://api.platica.mx/v1/agents/{agentId}

URL parameters

ParameterTypeDescriptionRequired
agentIdstringUnique identifier of the agent

Request body

{
  "name": "Nuevo Nombre del Agente",
  "status": "active",
  "systemPrompt": "Nuevo prompt actualizado...",
  "phoneNumber": ["+1234567890", "+0987654321"],
  "owners": ["soporte@miempresa.com"],
  "enableFileAttachments": true,
  "workingMessage": {
    "enabled": true,
    "trigger": {
      "type": "toolName",
      "toolNames": ["api_get_orders", "search_products"],
      "match": "exact"
    },
    "message": {
      "enabled": true,
      "mode": "ai",
      "aiPrompt": "Genera un mensaje breve avisando que estás consultando información del cliente."
    },
    "sticker": {
      "enabled": false
    }
  },
  "supportInformation": {
    "supportEmail": "nuevo-soporte@miempresa.com",
    "serviceHours": {
      "monday": {
        "availability": "Abierto",
        "start": "8:00am", 
        "end": "6:00pm"
      }
    }
  }
}

Body parameters

All parameters are optional. Only the fields included in the request are updated.

ParameterTypeDescription
namestringAgent name (1-100 characters)
statusstringAgent state ("active" or "inactive")
channelstringAgent platform
systemPromptstringSystem prompt. Automatically versioned — equivalent to calling POST /v1/agents/{agentId}/prompt (creates a history entry and rolls activePromptId).
channelIdstring | arrayCommunication channel ID(s). May be a single internal ID or an array.
phoneNumberstring | arrayPhone number(s) in international format, or an array.
imageUrlstringAgent image URL
supportInformationobjectSupport information and hours (partial update)
assistanceTriggersstringHuman-assist triggers
waitMessagestringWait message
assistanceEnabledbooleanWhether human assistance is enabled
recallLastConversationbooleanMemory across conversations: injects the summary of the last conversation into the prompt
enableFileAttachmentsbooleanFile reading: the agent accepts and processes attachments (images, audios, documents)
disableContextSummarizationbooleanKeep full history: skips automatic context compaction
workingMessageobject"Working" message sent to the customer when the agent is busy calling tools. See the full shape below.
ownersarrayList of responsible-user emails

Response

{
  "status": "success",
  "message": "Agent updated successfully",
  "data": {
    "id": "agent_abc123"
  }
}

Configuration of the wait message sent to the customer when the agent is processing a tool sequence that may take a while.

{
  "enabled": true,
  "trigger": {
    "type": "toolCallCount",
    "minToolCalls": 2
  },
  "message": {
    "enabled": true,
    "mode": "fixed",
    "fixedText": "Dame un momento, estoy procesando tu solicitud…"
  },
  "sticker": {
    "enabled": false
  }
}

enabled (boolean)

Turns the wait-message delivery on or off.

trigger (object) — when it fires

FieldTypeDescription
type"toolCallCount" \| "toolName" \| "any"Trigger mode. See table below.
minToolCallsinteger (1-10)Only applies when type is "toolCallCount" or "any". How many tools the agent must have called before sending the message.
toolNamesstring[]Only applies when type is "toolName" or "any". Tool names that trigger the message as soon as they are invoked.
match"exact" \| "prefix"How to compare against toolNames. Default "exact". With "prefix", e.g. "api_" activates for api_get_orders, api_search, etc.
typeMeaning
toolCallCountFires after N tool calls (uses minToolCalls).
toolNameFires when the agent calls a tool whose name is in toolNames.
anyFires on either of the two conditions above.

message (object) — what is sent

FieldTypeDescription
enabledbooleanWhether to send a text message (you can disable it and send only a sticker).
mode"fixed" \| "ai""fixed" sends literal text; "ai" generates it with AI based on a prompt.
fixedTextstringLiteral text to send (when mode is "fixed").
aiPromptstringInstruction for the AI that generates the message (when mode is "ai").

sticker (object) — optional sticker

FieldTypeDescription
enabledbooleanWhether a sticker is sent alongside the message.
urlstringSticker URL (when enabled is true).

Notes

  • owners must be sent as valid emails of users in the workspace
  • channelId and phoneNumber can be sent as a string or an array
  • in read responses, comunicationChannel.channelId and comunicationChannel.phoneNumber are always returned as arrays
  • Passing systemPrompt here creates a new entry in the history. If you need more control (edit text, view versions), use the dedicated prompt and versions endpoints.