Loading…
We'll authenticate, upload a document, generate a shared link, attach a webhook, and verify its signature.
Open Settings → API keys and create a key with the links:write and documents:write scopes. Export it:
export SENDMINT_API_KEY="sk_live_2j9hf2..."All requests use Bearer auth. Keys are workspace-scoped and rotatable.
Two-step upload: request a signed URL, PUT the bytes.
curl https://api.sendmint.com/v1/documents \
-H "Authorization: Bearer $SENDMINT_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "filename": "Series-A-deck.pdf", "size": 1842311 }'
# returns { "id": "doc_2j9hf2", "upload_url": "https://..." }
curl -X PUT "$UPLOAD_URL" \
-H "Content-Type: application/pdf" \
--data-binary @Series-A-deck.pdfcurl https://api.sendmint.com/v1/links \
-H "Authorization: Bearer $SENDMINT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"document_id": "doc_2j9hf2",
"email_required": true,
"watermark": "{recipient.email}",
"expires_at": "2026-12-31T23:59:59Z"
}'
# returns { "id": "lk_8j2hf", "url": "https://send.sendmint.com/lk_8j2hf", ... }The returned url is the live shareable link. Analytics start immediately.
curl https://api.sendmint.com/v1/webhooks \
-H "Authorization: Bearer $SENDMINT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://yourapp.com/webhooks/sendmint",
"events": ["link.visited", "envelope.signed", "proposal.accepted"]
}'import { createHmac, timingSafeEqual } from "node:crypto";
// app/api/sendmint-webhook/route.ts
// export this as POST from a Next route handler:
async function handleWebhook(req: Request) {
const sig = req.headers.get("x-sendmint-signature")!;
const body = await req.text();
const expected = createHmac("sha256", process.env.SENDMINT_SECRET!)
.update(body)
.digest("hex");
if (!timingSafeEqual(Buffer.from(sig), Buffer.from(expected))) {
return new Response("invalid signature", { status: 401 });
}
const event = JSON.parse(body);
// handle event.type → event.data
return new Response("ok");
}60-day trial. Full API surface from day one.