Update pending items

SDK platic.agents.templateSetup.update()

Manage the pending list with action: skip or restore an optional item, finish the list or dismiss it. To resolve an item, change the agent’s configuration; Platica marks it as done when it detects the change. This route manages the list and does not modify or publish the agent.

Example

await platic.agents.templateSetup.update("agent_123", { action: "complete" });

Path parameters

ParameterTypeDescriptionRequired
agentIdstringAgent id✓

Request body

FieldTypeDescriptionRequired
actionstringskip, unskip, complete or dismiss✓
slotIdstringThe pending item's id. Only with skip and unskip, and there it is mandatory—
actionWhat it does
skipSkips an optional pending item: it becomes skipped and counts in done
unskipBrings a skipped pending item back to pending
completeFinishes the template. Only when ready is true: all the required items are done
dismissDismisses the list. The agent keeps everything it has, without the pending items
{
  "action": "skip",
  "slotId": "conocimiento"
}

complete and dismiss close the list: afterwards, pending items can no longer be skipped or brought back. Repeating complete on a finished list, or dismiss on a dismissed one, answers the list as it is.

Response

200 OK, with the list after the change, in the shape of Get pending items. The example is complete:

{
  "status": "success",
  "message": "Template finished",
  "data": {
    "agentId": "Ag6bV8nM1qW3eR5t",
    "setup": {
      "template": { "slug": "vendedor-de-tienda", "name": "Vendedor de la tienda", "version": 3 },
      "status": "completed",
      "ready": true,
      "done": 4,
      "total": 4,
      "slots": [
        { "id": "negocio", "kind": "variable", "label": "Datos del negocio", "detail": "Horario", "required": true, "state": "done", "variables": [{ "key": "horario", "label": "Horario", "placeholder": "{{horario}}" }], "openUrl": null },
        { "id": "tool-shopify", "kind": "tool", "label": "Shopify", "detail": "Conéctala y actívala para este agente", "required": false, "state": "done", "provider": { "type": "mcp", "id": "shopify" }, "openUrl": null },
        { "id": "canal", "kind": "channel", "label": "Canal", "detail": "WhatsApp", "required": true, "state": "done", "channels": [{ "id": "whatsapp", "name": "WhatsApp" }], "openUrl": "https://app.platica.mx/workspace/K7u9rQ2LmZx18BvC5tNd/integrations" },
        { "id": "conocimiento", "kind": "knowledge", "label": "Catálogo", "detail": "Tu catálogo de productos con precios", "required": false, "state": "skipped", "hint": "Tu catálogo de productos con precios", "openUrl": null }
      ]
    }
  },
  "nextStep": "The template is finished. Publish the agent when it is ready with POST /v1/agents/Ag6bV8nM1qW3eR5t/publication."
}

message is Item skipped, Item pending again, Template finished or Template dismissed, depending on the action.

Errors

Statusdetails.codeWhen
400INVALID_REQUESTaction isn't valid, slotId is missing with skip or unskip, the body includes another field or agentId isn't a valid id. details.issues says which
400AGENT_TEMPLATE_SLOT_REQUIREDYou tried to skip a required pending item
403FORBIDDENYour token only sees your assigned agents and this one isn't yours
404AGENT_NOT_FOUNDThe agent doesn't exist in this workspace
404AGENT_TEMPLATE_SETUP_NOT_FOUNDThe agent doesn't come from a template
404AGENT_TEMPLATE_SLOT_NOT_FOUNDThere is no pending item with that slotId
409AGENT_TEMPLATE_SETUP_INCOMPLETEcomplete with required pending items not done. See which ones with Get pending items
409AGENT_TEMPLATE_SETUP_CLOSEDThe list is already finished or dismissed. details.status says which

The errors that come up on any operation are in the introduction.

Notes