Skip to main content

Download Smart Report PDF

Download the rendered PDF file for a SmartReport as a binary stream (Content-Type: application/pdf). Use this endpoint whenever your backend, portal, or integration needs raw PDF bytes rather than the base64 JSON envelope returned by Generate Smart Report PDF.

The optional rowIndex query parameter selects which row in the linked SmartBatch to render or download. If rowIndex is omitted, the endpoint falls back to dataSnapshot.rowIndex on the SmartReport, and then to 0.

Endpoint​

GET https://api.verifik.co/v2/smart-reports/{id}/download

This endpoint is also reachable through the Smart-Agent proxy at https://ai.verifik.co/v2/smart-reports/{id}/download using your own per-client Authorization: Bearer <VERIFIK_JWT>. Shared x402 execution is blocked with 403 Forbidden.

Headers​

NameValueDescription
Acceptapplication/pdfBinary PDF response stream.
AuthorizationBearer <VERIFIK_JWT>Client-scoped JWT (authUser.clientId).

Parameters​

NameLocationTypeRequiredDescription
idpathstringYesSmartReport ObjectId.
rowIndexquerynumberNoZero-based row index to download. Falls back to dataSnapshot.rowIndex, then 0.

Request​

Because this endpoint streams raw binary PDF bytes rather than JSON, configure your HTTP client to read binary buffers rather than parsing JSON.

import fs from "fs";
import axios from "axios";

const run = async () => {
const id = "6801a2b3c4d5e6f7a8b9c0d1";
const response = await axios.get(`https://api.verifik.co/v2/smart-reports/${id}/download`, {
params: { rowIndex: 0 },
responseType: "arraybuffer",
headers: {
Accept: "application/pdf",
Authorization: `Bearer ${process.env.VERIFIK_JWT}`,
},
});

fs.writeFileSync("report.pdf", Buffer.from(response.data));
console.log(`Saved report.pdf (${response.data.byteLength} bytes)`);
};

run();

Response​

HTTP/1.1 200 OK
Content-Type: application/pdf
Content-Disposition: attachment; filename="Consulta_1.pdf"
Content-Length: 148320

%PDF-1.4
... (binary PDF stream) ...

Response headers (200 OK)​

HeaderValue / FormatDescription
Content-Typeapplication/pdfBinary PDF MIME type.
Content-Dispositionattachment; filename="Consulta_<rowIndex+1>.pdf"Attachment filename using one-based row numbering (e.g. Consulta_1.pdf for rowIndex: 0).
Content-LengthInteger byte lengthExact byte size of the streamed PDF.

Error codes​

StatusError Code / TypeCause
401UnauthorizedMissing or invalid JWT.
403ForbiddenShared x402 execution was attempted; use your own per-client JWT.
404not_foundReport ID does not exist or belongs to another client.
404template_not_foundLinked template could not be found.
409MissingParameterJoi validation failed on query or path parameters.
409row_not_foundThe resolved rowIndex does not exist in the batch.
422UnprocessableEntityMongoose validation error.

Webhooks & MCP Integration​