Confirmación humana
curl --request POST \
--url https://sandbox.cucu.bo/api/v3/confirmations/{confirmationId}import requests
url = "https://sandbox.cucu.bo/api/v3/confirmations/{confirmationId}"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://sandbox.cucu.bo/api/v3/confirmations/{confirmationId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.cucu.bo/api/v3/confirmations/{confirmationId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://sandbox.cucu.bo/api/v3/confirmations/{confirmationId}"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sandbox.cucu.bo/api/v3/confirmations/{confirmationId}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.cucu.bo/api/v3/confirmations/{confirmationId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyConfirmación humana
Lo irreversible que pide un agente de IA lo aprueba una persona: 428 CONFIRMATION_REQUIRED, código de un solo uso y POST /api/v3/confirmations/.
POST
/
api
/
v3
/
confirmations
/
{confirmationId}
Confirmación humana
curl --request POST \
--url https://sandbox.cucu.bo/api/v3/confirmations/{confirmationId}import requests
url = "https://sandbox.cucu.bo/api/v3/confirmations/{confirmationId}"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://sandbox.cucu.bo/api/v3/confirmations/{confirmationId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.cucu.bo/api/v3/confirmations/{confirmationId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://sandbox.cucu.bo/api/v3/confirmations/{confirmationId}"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sandbox.cucu.bo/api/v3/confirmations/{confirmationId}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.cucu.bo/api/v3/confirmations/{confirmationId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyUna llave de agente (emitida con aprobación obligatoria) no ejecuta nada irreversible sin que una persona de la
empresa lo apruebe. Vale igual por REST y por MCP. Las llaves de ERP, POS e integradores no cambian: para ellas este
flujo no existe.
Operaciones que lo exigen: Se ejecuta exactamente lo congelado (no mandás argumentos de la operación) y responde lo mismo que habría respondido
la operación original: mismo status y cuerpo. MCP:
Cada código se gasta antes de ejecutar: a lo sumo una ejecución. Si el SIN falla después, pedí otra confirmación.
POST /invoices/{id}/cancel, cancel-administrative, cancel-note (deprecada), revert-cancel,
credit-note, POST /events/end, /events/restamp-cufd, /massive/end, DELETE /webhooks/endpoints/{id} y
/rotate-secret (tools: anularFactura, revertirAnulacion, crearNotaCreditoDebito, cerrarEvento,
resellarFacturasEvento, cerrarLoteMasivo, eliminarWebhook, rotarSecretoWebhook). En MCP son exactamente las tools
con annotations.destructiveHint: true (más confirmarAccion y las de administración que piden confirmación), así un
cliente MCP sabe de antemano cuáles van a pedir aprobación.
Flujo
1
Pedís la operación
La operación no se ejecuta: queda congelada con sus argumentos y responde Leé
428.{
"success": false,
"message": "confirmationId=Qm9…x2 expiresAt=2026-11-18T16:10:00Z canales=WHATSAPP,EMAIL efecto=\"Anular la factura 17 (Bs 500,00)…\". No se ejecutó nada: …",
"error": {
"code": "CONFIRMATION_REQUIRED",
"details": "confirmationId=Qm9…x2 expiresAt=2026-11-18T16:10:00Z canales=WHATSAPP,EMAIL",
"traceId": "4bf92f3577b34da6a3ce929d0e0e4736",
"docUrl": "https://docs.cucu.bo/errors#confirmation_required"
},
"timestamp": "2026-11-18T12:00:00.000-04:00"
}
confirmationId y expiresAt de error.details (formato estable clave=valor). En MCP llega como isError con
[CONFIRMATION_REQUIRED] confirmationId=… expiresAt=… canales=… efecto="…".2
El aprobador recibe un código
Un código de 6 dígitos, de un solo uso, por WhatsApp y/o correo: un canal que el agente no ve. El correo incluye el
efecto (número de factura, monto, punto de venta; nunca datos del comprador). Vence a los 10 minutos.
3
Confirmás con el código
curl -X POST https://sandbox.cucu.bo/api/v3/confirmations/Qm9…x2 \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"code": "482913"}'
confirmarAccion(confirmationId, codigo), cuyo structuredContent es el de la tool confirmada (outputSchema objeto).Errores
| HTTP | error.code | Qué pasó | Qué hacer |
|---|---|---|---|
428 | CONFIRMATION_REQUIRED | Operación congelada | Pedir el código al aprobador |
400 | VALIDATION_ERROR | Falta code o el cuerpo | Enviar {"code": "…"} |
403 | CONFIRMATION_CODE_INVALID | Código incorrecto (details: intentosRestantes=<n>, se descarta a los 5) | Reintentar con el código correcto |
404 | CONFIRMATION_NOT_FOUND | Vencida, usada, de otra empresa o inexistente | Repetir la operación original |
409 | CONFIRMATION_MISMATCH | Lo que se iba a ejecutar no es lo aprobado | Pedir otra confirmación |
409 | APPROVER_NOT_CONFIGURED | La empresa no tiene aprobador | Pedir a CUCU que lo configure |
503 | APPROVER_UNREACHABLE | El código no salió por ningún canal | Reintentar más tarde |
429 | RATE_LIMITED | Demasiadas confirmaciones pendientes | Usar las pendientes o esperar Retry-After |
Configurar
El aprobador (WhatsApp en E.164 y/o correo) es dato de cada empresa y lo carga CUCU; la llave de la empresa no puede nombrarlo. Para darle un agente a una empresa: aprobador configurado + llave emitida conrequiereAprobacion=true
(generarApiKey). La llave del agente y la del ERP rotan por separado.