curl --request PATCH \
--url https://api.tupana.ai/v2/webhooks/{webhook_id}/ \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"api_version": 2
}
'import requests
url = "https://api.tupana.ai/v2/webhooks/{webhook_id}/"
payload = { "api_version": 2 }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({api_version: 2})
};
fetch('https://api.tupana.ai/v2/webhooks/{webhook_id}/', 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://api.tupana.ai/v2/webhooks/{webhook_id}/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'api_version' => 2
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tupana.ai/v2/webhooks/{webhook_id}/"
payload := strings.NewReader("{\n \"api_version\": 2\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.tupana.ai/v2/webhooks/{webhook_id}/")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"api_version\": 2\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tupana.ai/v2/webhooks/{webhook_id}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"api_version\": 2\n}"
response = http.request(request)
puts response.read_body{
"id": "dowe_2c9e5a1b7f3d0",
"url": "<string>",
"events": [
"document.issued"
],
"events_display": [
"Emitido",
"Entregado",
"Rechazado SII"
],
"secret": "<string>",
"is_active": true,
"last_status_code": 123,
"last_sent_at": "2023-11-07T05:31:56Z",
"success_rate": 50,
"last_delivery": {
"id": "wede_5f1c2a9b7d3e0",
"event": "<string>",
"is_success": true,
"status_code": 123,
"sent_at": "2023-11-07T05:31:56Z",
"document_id": 123
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"environment": "both",
"api_version": 1
}{
"error": "VALIDATION_ERROR",
"message": "<string>"
}{
"error": "VALIDATION_ERROR",
"message": "<string>"
}{
"error": "VALIDATION_ERROR",
"message": "<string>"
}Actualizar webhook
Modifica uno o más campos del webhook. Es la forma de subir un webhook creado antes de octubre 2026 al contrato de ids públicos: {"api_version": 2}.
curl --request PATCH \
--url https://api.tupana.ai/v2/webhooks/{webhook_id}/ \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"api_version": 2
}
'import requests
url = "https://api.tupana.ai/v2/webhooks/{webhook_id}/"
payload = { "api_version": 2 }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({api_version: 2})
};
fetch('https://api.tupana.ai/v2/webhooks/{webhook_id}/', 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://api.tupana.ai/v2/webhooks/{webhook_id}/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'api_version' => 2
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tupana.ai/v2/webhooks/{webhook_id}/"
payload := strings.NewReader("{\n \"api_version\": 2\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.tupana.ai/v2/webhooks/{webhook_id}/")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"api_version\": 2\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tupana.ai/v2/webhooks/{webhook_id}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"api_version\": 2\n}"
response = http.request(request)
puts response.read_body{
"id": "dowe_2c9e5a1b7f3d0",
"url": "<string>",
"events": [
"document.issued"
],
"events_display": [
"Emitido",
"Entregado",
"Rechazado SII"
],
"secret": "<string>",
"is_active": true,
"last_status_code": 123,
"last_sent_at": "2023-11-07T05:31:56Z",
"success_rate": 50,
"last_delivery": {
"id": "wede_5f1c2a9b7d3e0",
"event": "<string>",
"is_success": true,
"status_code": 123,
"sent_at": "2023-11-07T05:31:56Z",
"document_id": 123
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"environment": "both",
"api_version": 1
}{
"error": "VALIDATION_ERROR",
"message": "<string>"
}{
"error": "VALIDATION_ERROR",
"message": "<string>"
}{
"error": "VALIDATION_ERROR",
"message": "<string>"
}url, events, secret, is_active, environment o api_version.
Es la forma de subir un webhook creado antes de octubre de 2026 al contrato de ids públicos:
{ "api_version": 2 }
data.id, sender.id y receiver.id llegan como docu_… y ment_…. Ver Identificadores en el payload.Authorizations
API Key para autenticación. Debe proporcionarse en el header Authorization con el formato: 'Api-Key YOUR-API-KEY' (incluye el prefijo 'Api-Key ' seguido de tu API key)
Path Parameters
public_id del webhook (dowe_…)
Body
Campos editables de un webhook. Todos opcionales (PATCH).
URL del endpoint que recibirá las notificaciones
Lista de eventos a notificar
1document.issued, document.delivered, document.rejected, document.trace_updated, document.paid, document.unpaid, document.cancelled Clave secreta para verificar la autenticidad de las notificaciones
255Si el webhook está activo
De qué ambiente recibe eventos de documentos: both (default), production o sandbox. Los eventos que no son de documento (credenciales, folios, cobros, programados) se entregan como producción.
both, production, sandbox Formato de los identificadores que viajan en el payload. 2: todos los ids son public_id (docu_… documento, ment_… emisor/receptor, scdo_… programado, fir_… solicitud de folios, dowe_… webhook). 1: ids enteros, el contrato de la API v1. Si se omite, el default sigue la ruta de creación: /v2/webhooks/ crea en 2 y /v1/webhooks/ crea en 1 (desde la plataforma, la versión que ya usa la empresa). Los webhooks creados antes de octubre 2026 quedaron en 1: súbelos con PATCH o desde la plataforma.
1, 2 Response
Webhook
ID único del webhook
"dowe_2c9e5a1b7f3d0"
URL del endpoint que recibe las notificaciones
Lista de eventos configurados
document.issued, document.delivered, document.rejected, document.trace_updated, document.paid, document.unpaid, document.cancelled Nombres legibles de los eventos
["Emitido", "Entregado", "Rechazado SII"]
Clave secreta para verificar notificaciones
Si el webhook está activo
Último código HTTP de respuesta
Fecha de último envío
Tasa de éxito de entregas (0-100)
0 <= x <= 100Información de la última entrega
Show child attributes
Show child attributes
Fecha de creación
Fecha de última actualización
De qué ambiente recibe eventos de documentos: both (default), production o sandbox. Los eventos que no son de documento (credenciales, folios, cobros, programados) se entregan como producción.
both, production, sandbox Formato de los identificadores que viajan en el payload. 2: todos los ids son public_id (docu_… documento, ment_… emisor/receptor, scdo_… programado, fir_… solicitud de folios, dowe_… webhook). 1: ids enteros, el contrato de la API v1. Si se omite, el default sigue la ruta de creación: /v2/webhooks/ crea en 2 y /v1/webhooks/ crea en 1 (desde la plataforma, la versión que ya usa la empresa). Los webhooks creados antes de octubre 2026 quedaron en 1: súbelos con PATCH o desde la plataforma.
1, 2 