WhatsApp tools workflow
WhatsApp tools are company templates the bot uses to prepare operation drafts. They are the sameWhatsAppOperationTool rows as Configuración → WhatsApp → Tools. Authenticate with x-api-key.
The dashboard employee session API stays at /api/kapso/tools. This public integrator surface is /api/whatsapp/tools so it matches other company-scoped catalogs (/api/tags, /api/operation-types).
Delete is a soft-delete (deleted_at + enabled=false), same as the dashboard. List never returns soft-deleted tools; it does include disabled ones.
operationTypeId lives inside fixed_config (dashboard field). There is no top-level operation_type_id. Cross-company IDs are rejected.
List tools (including disabled)
id, name, slug, enabled, company_operation_type_id, fixed_config, parameter_schema, …).
Create a tool
Body shape matches the dashboard form:name, optional slug / description / enabled, required fixed_config, optional parameter_schema (defaults to no dynamic fields).
fixed_config.toolKind must match the company operation type: up/down → up_down, other → other, exchange → exchange, budget → budget.
slug for the same company returns 409. Invalid fixed_config or an operationTypeId that is not this company’s (or the wrong base type) returns 400.
OTHER example
EXCHANGE example
BUDGET example
Budget tools do not send up/downmode, source, or destination. Direction defaults to expense (same as the dashboard budget form). paymentSourceMode defaults to internal (caja). Expense + external drafts the same Gastos op as the dashboard: credit payerClientId (type=1, not the center client), no caja debit. Source, centro, amount, and description can each be fixed or a param. If internalAccountId is omitted on internal, confirm uses the cost center default caja.
toolKind=up_down returns 400.
Enable, rename, or update config
Soft-delete
204. Soft-deleted tools disappear from GET and return 404 on later PATCH/DELETE.
Company agent prompt (prompt base del bot)
House rules appended after the global WhatsApp agent prompt. They never replace accounting or safety rules. This is the same value as the dashboard card in Configuración → WhatsApp → Tools (employee route/api/kapso/system-prompt-extra), just with x-api-key.
Read
{ "system_prompt_extra": "..." }, or null when unset.
Set or clear
Send the text to replace it, ornull / "" to clear it (the bot falls back to the global prompt). The value is trimmed and capped at 12.000 characters; longer bodies return 400.
Related endpoints
GET /api/whatsapp/toolsPOST /api/whatsapp/toolsGET /api/whatsapp/tools/{id}PATCH /api/whatsapp/tools/{id}DELETE /api/whatsapp/tools/{id}GET /api/whatsapp/system-prompt-extraPATCH /api/whatsapp/system-prompt-extraGET /api/operation-types— resolvefixed_config.operationTypeId- Dashboard catalog/apply (employee session,
whatsapp.manage):GET /api/kapso/tool-templates,POST /api/kapso/tool-templates/apply