Actualizar un Smart Report
Actualiza un SmartReport existente perteneciente al cliente autenticado. Envía únicamente los campos que deseas modificar; los campos omitidos en la solicitud permanecen sin cambios.
Si el ID del reporte no existe o pertenece a otro cliente, el endpoint devuelve 404 Not Found ({ "message": "not_found", "code": "NotFound" }).
Endpoint
PUT https://api.verifik.co/v2/smart-reports/{id}
Este endpoint también es accesible a través del proxy de Smart-Agent en https://ai.verifik.co/v2/smart-reports/{id} usando tu propio encabezado por cliente Authorization: Bearer <VERIFIK_JWT>. La ejecución compartida mediante x402 está bloqueada con 403 Forbidden.
Encabezados
| Nombre | Valor | Descripción |
|---|---|---|
Content-Type | application/json | Formato del payload de la solicitud. |
Authorization | Bearer <VERIFIK_JWT> | JWT con alcance de cliente (authUser.clientId). |
Parámetros
| Nombre | Tipo | Requerido | Descripción |
|---|---|---|---|
id | string | Sí | ObjectId de SmartReport a actualizar. |
Cuerpo
Todos los campos del cuerpo son opcionales; proporciona únicamente los atributos que quieras actualizar.
| Nombre | Tipo | Requerido | Descripción |
|---|---|---|---|
name | string | No | Nombre visible para el reporte. |
status | string | No | Estado del reporte: "draft", "generating", "generated", "sent" o "failed". |
pdfUrl | string | No | URL almacenada del artefacto PDF generado. |
pdfSize | number | No | Tamaño del PDF generado en bytes. |
htmlSnapshot | string | No | Instantánea HTML guardada del reporte renderizado. |
pageCount | number | No | Cantidad de páginas del PDF generado. |
pdfEngine | string | No | Motor de renderizado: "pdfkit" o "puppeteer". |
generatedAt | string | No | Marca de tiempo ISO 8601 de cuando se generó el reporte. |
generationDurationMs | number | No | Duración de la generación del PDF en milisegundos. |
dataSnapshot | object | No | Instantánea de datos de fila o de entrada usados para el reporte. |
externalRefId | string | No | Identificador de correlación del llamador. |
webhookUrl | string | No | URL webhook http o https de sobrescritura por reporte. |
rowIndex | number | No | Índice de fila base cero asociado con este reporte. |
createdByChannel | string | No | Canal de origen: "portal", "api", "mcp", "x402" o "webhook". |
verificationScoreSummary | object | No | Metadatos de resumen de la puntuación de verificación. |
error | object o string | No | Payload o mensaje de error registrado para estados fallidos. |
Solicitud
- Node.js
- PHP
- Python
- Go
- cURL
import axios from "axios";
const run = async () => {
const id = "6801a2b3c4d5e6f7a8b9c0d1";
const { data } = await axios.put(
`https://api.verifik.co/v2/smart-reports/${id}`,
{
name: "Background Check - Applicant 42 (Reviewed)",
externalRefId: "applicant-42-v2",
webhookUrl: "https://webhooks.example.com/verifik",
},
{
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${process.env.VERIFIK_JWT}`,
},
}
);
console.log(data);
};
run();
<?php
$id = "6801a2b3c4d5e6f7a8b9c0d1";
$ch = curl_init("https://api.verifik.co/v2/smart-reports/" . $id);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Content-Type: application/json",
"Authorization: Bearer " . getenv("VERIFIK_JWT"),
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
"name" => "Background Check - Applicant 42 (Reviewed)",
"externalRefId" => "applicant-42-v2",
"webhookUrl" => "https://webhooks.example.com/verifik",
]));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
import os
import requests
report_id = "6801a2b3c4d5e6f7a8b9c0d1"
url = f"https://api.verifik.co/v2/smart-reports/{report_id}"
headers = {
"Content-Type": "application/json",
"Authorization": f"Bearer {os.getenv('VERIFIK_JWT')}",
}
payload = {
"name": "Background Check - Applicant 42 (Reviewed)",
"externalRefId": "applicant-42-v2",
"webhookUrl": "https://webhooks.example.com/verifik",
}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
"os"
)
func main() {
id := "6801a2b3c4d5e6f7a8b9c0d1"
body, _ := json.Marshal(map[string]interface{}{
"name": "Background Check - Applicant 42 (Reviewed)",
"externalRefId": "applicant-42-v2",
"webhookUrl": "https://webhooks.example.com/verifik",
})
req, _ := http.NewRequest("PUT", "https://api.verifik.co/v2/smart-reports/"+id, bytes.NewReader(body))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer "+os.Getenv("VERIFIK_JWT"))
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
var out map[string]interface{}
json.NewDecoder(resp.Body).Decode(&out)
fmt.Println(out)
}
curl -X PUT "https://api.verifik.co/v2/smart-reports/6801a2b3c4d5e6f7a8b9c0d1" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $VERIFIK_JWT" \
-d '{
"name": "Background Check - Applicant 42 (Reviewed)",
"externalRefId": "applicant-42-v2",
"webhookUrl": "https://webhooks.example.com/verifik"
}'
Respuesta
- 200 OK
- 401
- 403
- 404
- 409
- 422
{
"data": {
"_id": "6801a2b3c4d5e6f7a8b9c0d1",
"template": "6801a2b3c4d5e6f7a8b9c0d2",
"smartBatch": "6801a2b3c4d5e6f7a8b9c0d3",
"name": "Background Check - Applicant 42 (Reviewed)",
"status": "generated",
"externalRefId": "applicant-42-v2",
"webhookUrl": "https://webhooks.example.com/verifik",
"rowIndex": 0,
"createdByChannel": "api",
"createdAt": "2026-11-24T20:00:00.000Z",
"updatedAt": "2026-11-24T20:05:00.000Z"
}
}
{
"message": "Unauthorized",
"code": "Unauthorized"
}
{
"message": "Shared x402 execution is forbidden on this endpoint",
"code": "Forbidden"
}
{
"message": "not_found",
"code": "NotFound"
}
{
"message": "\"status\" must be one of [draft, generating, generated, sent, failed]",
"code": "MissingParameter"
}
{
"message": "UnprocessableEntity",
"code": "UnprocessableEntity"
}
Integración con Webhooks y MCP
- Actualizar
webhookUrloexternalRefIdactualiza la URL de callback destino y el ID de correlación usados por llamadas posteriores de Generar PDF de Smart Report y Enviar Smart Report por correo electrónico. Consulta Webhooks de SmartReports. - Para inspeccionar el registro actualizado o ejecutar operaciones de reporte headless mediante un agente de IA, consulta MCP y Agentes de IA.
Notas
- Actualizar un
SmartReportsolo modifica los campos guardados en el reporte; no regenera automáticamente un PDF ni envía correos. Llama a Generar PDF de Smart Report o Enviar Smart Report por correo electrónico cuando quieras volver a renderizar o enviar.