POST /v1/sign
Configure the server’s signing certificate, then submit the assembled PDF and signing details. This Node.js example saves the signed PDF.
import { readFile, writeFile } from "node:fs/promises";
const pdf = await readFile("agreement.pdf", "base64");
const response = await fetch("http://localhost:8080/v1/sign", {
method: "POST",
headers: {
Authorization: "Bearer " + process.env.PRESSJET_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
version: 1,
pdf,
signature: {
name: "Example Organization",
reason: "Agreement approval",
signingTime: new Date().toISOString(),
},
}),
});
if (!response.ok) throw new Error(await response.text());
await writeFile("signed-agreement.pdf", Buffer.from(await response.arrayBuffer()));
Configure the signing certificate ↗