Developers
Tokoman API
Everything a program can do with Tokoman: create and version templates, generate documents, fetch them, and be told when they are ready.
The API lives at https://api.tokoman.com/v1. Requests and responses are JSON. Every request carries an API key in the Authorization header. GET /v1 with your key returns an index of every operation and the scopes your key holds, so the first call you make tells you what the rest can do.
Two ways in
REST, for the common case: one request, one document, the response carries the link. The realtime namespace, for a long-lived connection that generates without polling and receives a change feed of what happened. Both use the same key and the same permissions.
One way out
A webhook. Register an endpoint, and every finished or failed document is POSTed to it, signed, with the download link and whatever metadata you attached to the request. Deliveries are retried for an hour if your endpoint is down.
Identifiers
Templates are addressed by id or by slug; the slug is the one you will remember. Documents are addressed by id, or by the correlationId you gave them, which is your own reference: an invoice number, an application number. Everything echoes it back.
GET https://api.tokoman.com/v1
Authorization: Bearer tkm_live_…
{
"success": true,
"version": "v1",
"organisation": "…",
"scopes": [{ "scope": "documents.generate", "label": "Generate documents" }],
"operations": [{ "method": "POST", "path": "/v1/documents", "summary": "Generate a document. Waits for the PDF unless wait: false." }]
}