Gen API Overview
The Gen API enables you to generate documents programmatically from templates with merge data, batch processing, versioning, and governance workflows.
Key Features
- Template Management - Create, version, and promote reusable document templates
- Document Generation - Generate PDF and HTML documents from templates with merge data
- Batch Processing - Generate hundreds of documents in a single API call
- Template Versioning - Track template changes with full version history
- Approval Workflows - Governance controls for template promotion across environments
Architecture
Core Concepts
Template
A template defines the structure and layout of a document. Templates contain placeholders for merge data that get filled during generation.
Template Version
Each template maintains a version history. New versions can be created, listed, and restored. Only approved versions can be promoted to production.
Document
A document is a generated output from a template combined with merge data. Documents can be in PDF or HTML format.
| Status | Description |
|---|---|
DRAFT | Created, not yet generating |
GENERATING | Generation in progress |
GENERATED | Successfully generated |
FAILED | Generation failed |
Batch
A batch generates multiple documents from a single template with different merge data in one API call.
| Status | Description |
|---|---|
PENDING | Queued for processing |
PROCESSING | Generation in progress |
COMPLETED | All documents generated |
FAILED | Batch processing failed |
CANCELLED | Batch was cancelled |
Approval
An approval is a governance gate for promoting templates between environments (DEV, TEST, PROD). Approvals can be approved or rejected with comments.
API Base URL
| Environment | Base URL |
|---|---|
| Production | https://api.propper.ai/v1/docgen |
Authentication
The Gen API uses OAuth 2.0 with bearer tokens:
POST https://auth.propper.ai/oauth2/token
Content-Type: application/json
{
"grant_type": "client_credentials",
"client_id": "YOUR_CLIENT_ID",
"client_secret": "YOUR_CLIENT_SECRET",
"scope": "docgen:read docgen:write"
}
OAuth Scopes
| Scope | Description |
|---|---|
docgen:read | Read templates, documents, batches, and approvals |
docgen:write | Create/update templates, generate documents, create batches |
docgen:admin | Archive/promote templates, cancel/retry batches, review approvals |
Rate Limits
API requests are rate limited to ensure fair usage and platform stability. See the Rate Limits page for details on limits, headers, and best practices.
Next Steps
Quickstart
Generate your first document in 5 minutes.
API Reference
Complete endpoint documentation with examples.