Retrieve Smart Report HTML
Retrieve the rendered HTML for a SmartReport, together with its linked batchId, templateId, rowIndex, optional verificationScore, and the corresponding row payload (rowIndex, status, inputData, results, errors).
Important: This endpoint responds with Content-Type: application/json and returns the HTML string inside data.html, not as a raw text/html document.
Endpoint
GET https://api.verifik.co/v2/smart-reports/{id}/html
This endpoint is also reachable through the Smart-Agent proxy at https://ai.verifik.co/v2/smart-reports/{id}/html using your own per-client Authorization: Bearer <VERIFIK_JWT>. Shared x402 execution is blocked with 403 Forbidden.
Headers
| Name | Value | Description |
|---|---|---|
Accept | application/json | JSON envelope response format. |
Authorization | Bearer <VERIFIK_JWT> | Client-scoped JWT (authUser.clientId). |
Parameters
| Name | Location | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | SmartReport ObjectId. |
rowIndex | query | integer | No | Zero-based row index (>= 0). |
preview | query | boolean | No | Render in preview mode when true. |
score | query | boolean | No | Whether to compute and include verificationScore in data. |
scoreProfile | query | string | No | Scoring profile identifier used when score is enabled (max 64 characters). |
Request
- Node.js
- PHP
- Python
- Go
- cURL
import axios from "axios";
const run = async () => {
const id = "6801a2b3c4d5e6f7a8b9c0d1";
const { data } = await axios.get(`https://api.verifik.co/v2/smart-reports/${id}/html`, {
params: {
rowIndex: 0,
preview: false,
score: true,
},
headers: {
Accept: "application/json",
Authorization: `Bearer ${process.env.VERIFIK_JWT}`,
},
});
console.log({
reportId: data.data.reportId,
htmlLength: data.data.html.length,
rowStatus: data.data.row?.status,
});
};
run();
<?php
$id = "6801a2b3c4d5e6f7a8b9c0d1";
$query = http_build_query([
"rowIndex" => 0,
"preview" => "false",
"score" => "true",
]);
$ch = curl_init("https://api.verifik.co/v2/smart-reports/" . $id . "/html?" . $query);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Accept: application/json",
"Authorization: Bearer " . getenv("VERIFIK_JWT"),
]);
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}/html"
headers = {
"Accept": "application/json",
"Authorization": f"Bearer {os.getenv('VERIFIK_JWT')}",
}
params = {
"rowIndex": 0,
"preview": False,
"score": True,
}
response = requests.get(url, params=params, headers=headers)
print(response.json())
package main
import (
"encoding/json"
"fmt"
"net/http"
"net/url"
"os"
)
func main() {
id := "6801a2b3c4d5e6f7a8b9c0d1"
params := url.Values{}
params.Set("rowIndex", "0")
params.Set("preview", "false")
params.Set("score", "true")
req, _ := http.NewRequest("GET", "https://api.verifik.co/v2/smart-reports/"+id+"/html?"+params.Encode(), nil)
req.Header.Set("Accept", "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 GET "https://api.verifik.co/v2/smart-reports/6801a2b3c4d5e6f7a8b9c0d1/html?rowIndex=0&preview=false&score=true" \
-H "Accept: application/json" \
-H "Authorization: Bearer $VERIFIK_JWT"
Response
- 200 OK
- 401
- 403
- 404
- 409
- 422
{
"data": {
"reportId": "6801a2b3c4d5e6f7a8b9c0d1",
"batchId": "6801a2b3c4d5e6f7a8b9c0d3",
"templateId": "6801a2b3c4d5e6f7a8b9c0d2",
"rowIndex": 0,
"html": "<!DOCTYPE html><html><head><meta charset=\"utf-8\" /></head><body><h1>Verification Report</h1></body></html>",
"verificationScore": {},
"row": {
"rowIndex": 0,
"status": "completed",
"inputData": {
"documentType": "CC",
"documentNumber": "1032386359"
},
"results": {},
"errors": []
}
}
}
{
"message": "Unauthorized",
"code": "Unauthorized"
}
{
"message": "Shared x402 execution is forbidden on this endpoint",
"code": "Forbidden"
}
{
"message": "template_not_found",
"code": "NotFound"
}
{
"message": "unknown_score_profile",
"code": "unknown_score_profile"
}
{
"message": "UnprocessableEntity",
"code": "UnprocessableEntity"
}
Error codes
| Status | Error Code / Type | Cause |
|---|---|---|
401 | Unauthorized | Missing or invalid JWT. |
403 | Forbidden | Shared x402 execution was attempted; use your own per-client JWT. |
404 | not_found | Report ID does not exist or belongs to another client. |
404 | template_not_found | Linked template could not be found. |
409 | MissingParameter | Joi validation failed on query or path parameters. |
409 | row_not_found | The requested rowIndex does not exist in the batch. |
409 | unknown_score_profile | The supplied scoreProfile is not recognized. |
422 | UnprocessableEntity | Mongoose validation error. |
Webhooks & MCP Integration
- MCP Equivalent: AI agents can retrieve the rendered report HTML and row structure via the
smart_report_get_htmlMCP tool. See MCP and AI Agents. - Webhooks: The
htmlUrlpath (/v2/smart-reports/{id}/html) is included in Run a Smart Report, Retrieve a Smart Report, and Generate Smart Report PDF responses. See Smart Reports Webhooks.
Notes
- Because the HTTP response uses
application/json, extractdata.htmlfrom the JSON payload before embedding it in a webview, iframe, or PDF renderer. data.verificationScoreis present whenscore=trueis passed.data.rowisnullif no batch row object is attached for the context.