API Quickstart & Authentication
Create personal API tokens in your account settings, authenticate HTTP requests via Bearer headers, and trigger automated generation via REST API.
The Trydoku REST API enables programmatic document automation from any backend language (PHP, Python, Node.js, Go, C#), CRM webhook, or low-code tool (Zapier, Make). This quickstart guides you through generating API tokens and executing your first generation request.
Step 1: Generating an API Token
- Open API Settings: Navigate to Settings > API in your Trydoku dashboard.
-
Create New Token: Click Create New API Token, provide a descriptive label (e.g.
Production Billing Worker), and select your desired permissions. - Secure Your Secret Key: Copy the token immediately. For security, Trydoku stores a SHA-256 hash of the token and never reveals the raw plaintext token again.
Step 2: Authentication Header
Every API request must include your token in the standard HTTP Authorization header using the Bearer scheme:
Authorization: Bearer YOUR_API_TOKEN_HERE
Step 3: Triggering Document Generation
Send a POST request to https://www.trydoku.com/api/v1/generate with your template identifier and data payload:
curl -X POST https://www.trydoku.com/api/v1/generate \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"template_id": "tpl_01h8abcdef1234567890",
"format": "pdf",
"data": {
"client_name": "Acme Global Corp",
"invoice_num": "INV-2026-0042",
"items": [
{"description": "Document Automation Enterprise License", "qty": 1, "price": 499.00}
]
}
}'
Expected JSON Response
{
"success": true,
"document_id": "doc_01h8xyz9876543210",
"download_url": "https://www.trydoku.com/api/v1/documents/doc_01h8xyz9876543210/download",
"format": "pdf",
"credits_remaining": 184
}
Rate Limiting & Safety Budgets
Standard production API tokens are budgeted for up to 60 requests per minute. Automated multi-layered rate limiters protect your credit balance and prevent duplicate concurrency bursts. For high-volume enterprise ingestion or custom webhook endpoints, check our full API Specification.
Put this into practice
Ready to take action or test what you've learned?