API Reference
Complete API reference for Wraft integration
Wraft API Reference
The Wraft API provides programmatic access to all core functionality, enabling you to integrate document automation into your existing applications and workflows.
๐ Authentication
Wraft uses API tokens for authentication. Include your token in the Authorization
header of all requests.
Getting Your API Token
- Log into your Wraft workspace
- Go to Settings โ API Tokens
- Click Generate New Token
- Copy and store the token securely
Security: API tokens provide full access to your workspace. Store them securely and rotate them regularly.
๐ Base URL
All API requests should be made to:
For self-hosted instances:
๐ Core Resources
๐ข Workspaces
Manage workspace settings and configurations
๐ Templates
Create and manage document templates
๐ Forms
Build and deploy data collection forms
๐ Pipelines
Automate document generation workflows
๐ Documents
Generate and manage documents
๐ฅ Users
Manage workspace members and permissions
๐ข Workspaces
List Workspaces
Response:
Get Workspace Details
Parameters:
workspace_id
(string): Unique workspace identifier
Create Workspace
Request Body:
๐ Templates
List Templates
Query Parameters:
page
(integer): Page number (default: 1)per_page
(integer): Items per page (default: 25, max: 100)search
(string): Search templates by name or contentcategory
(string): Filter by template category
Example:
Get Template
Response:
Create Template
Request Body:
Update Template
Delete Template
๐ Forms
List Forms
Create Form
Request Body:
Submit Form Data
Request Body:
๐ Pipelines
List Pipelines
Create Pipeline
Request Body:
Execute Pipeline
Request Body:
๐ Documents
Generate Document
Request Body:
Response:
Download Document
Response: Binary file content
List Documents
Query Parameters:
status
(string): Filter by status (pending, processing, completed, failed)template_id
(string): Filter by templatecreated_after
(datetime): Filter by creation dateformat
(string): Filter by output format
๐ฅ Users & Permissions
List Workspace Members
Invite User
Request Body:
๐ Webhooks
Configure webhooks to receive real-time notifications about events in your workspace.
Supported Events
Form Submission
form.submitted
Triggered when a form is submitted
Document Generated
document.generated
Triggered when document generation completes
Pipeline Executed
pipeline.executed
Triggered when a pipeline finishes execution
Template Updated
template.updated
Triggered when a template is modified
Configure Webhook
Request Body:
Webhook Payload Example
๐ Rate Limits
Rate Limits: API requests are limited to prevent abuse and ensure service quality.
Plan | Requests per minute | Concurrent requests |
---|---|---|
Free | 60 | 5 |
Pro | 300 | 15 |
Enterprise | 1000 | 50 |
Rate limit headers:
๐จ Error Handling
HTTP Status Codes
Code | Meaning |
---|---|
200 | Success |
201 | Created |
400 | Bad Request |
401 | Unauthorized |
403 | Forbidden |
404 | Not Found |
422 | Validation Error |
429 | Rate Limited |
500 | Server Error |
Error Response Format
๐ ๏ธ SDKs & Libraries
JavaScript/Node.js
npm install @wraft/sdk
Python
pip install wraft-python
Ruby
gem install wraft
PHP
composer require wraft/wraft-php
JavaScript Example
Python Example
๐งช Testing
API Explorer
Use our interactive API explorer to test endpoints:
Postman Collection
Import our Postman collection for easy testing:
Test Environment
Use our sandbox environment for development:
Sandbox: The sandbox environment resets daily and doesn't count against rate limits.