Developers
Quickstart
From nothing to a PDF in five requests. About four minutes.
1. Create an organisation and a key
Sign up on the sandbox. In the dashboard, open API keys and create one with the documents.generate and templates.read scopes. Copy it: it is shown once.
2. Copy a starter template
From the dashboard, or over the API. The starters are complete templates with a schema and sample data. Copying one gives you a template that generates immediately.
copy the invoice starter
curl -X POST https://api.tokoman.com/v1/templates/library/invoice/copy \
-H "Authorization: Bearer tkm_live_…"3. Generate a document
Send the template's slug and the data. By default the request waits for the PDF and answers with the finished document.
generate
curl -X POST https://api.tokoman.com/v1/documents \
-H "Authorization: Bearer tkm_live_…" \
-H "Content-Type: application/json" \
-d '{
"templateId": "invoice",
"correlationId": "INV-2026-0418",
"metadata": { "customerId": "KBF-0091" },
"data": {
"invoiceNumber": "INV-2026-0418",
"issueDate": "2026-09-12",
"dueDate": "2026-10-12",
"seller": { "name": "Marais Risk Advisors", "address": "12 Rivonia Road, Sandton" },
"client": { "name": "Kruger Bros Farming", "address": "Plot 44, Bela-Bela" },
"lineItems": [
{ "description": "Commercial property cover", "quantity": 1, "unitPrice": 18400, "total": 18400 }
],
"subtotal": 18400, "vatAmount": 2760, "total": 21160
}
}'the response
{
"success": true,
"data": {
"id": "8c1f5e4a-…",
"status": "completed",
"templateSlug": "invoice",
"templateVersion": 1,
"correlationId": "INV-2026-0418",
"pageCount": 1,
"byteSize": 18422,
"filename": "invoice-INV-2026-0418.pdf",
"downloadUrl": "https://…",
"downloadUrlExpiresAt": "2026-09-13T10:12:00.000Z",
"durationMs": 1104
},
"message": "1 page rendered."
}4. Fetch it later
bash
curl https://api.tokoman.com/v1/documents/8c1f5e4a-… -H "Authorization: Bearer tkm_live_…"The record comes back with a fresh download link if the previous one has expired.
5. Be told, instead of asking
Register a webhook endpoint (see Webhooks), and skip step 4 forever.
Sandbox documents carry a watermark and the sandbox stops at 100 pages a month. Everything else works exactly as on a paid plan.