API Documentation
Use our API to programmatically create documents from templates and manage e-signatures
Multi-Signer Support
Documents can have multiple signers with different roles. Each signer receives a unique signing link and can only fill fields assigned to their role.
Features:
⢠Each recipient gets a unique, secure signing URL
⢠Signers can see fields filled by previous signers (read-only)
⢠Document status updates as each signer completes their part
⢠Document is marked "completed" only when all signers have signed
Rate Limits & Pricing
Free tier: Create templates and send documents through the web interface.
API usage: $0.01 per document + $0.01 per signature/initials field.
Template storage: First 3 templates free, then $0.05/month per additional template.
Rate limit: 100 requests per hour per API key.
API Pricing
Simple, transparent pricing for API usage. Free for website users.
Example: A document with 2 signature fields costs $0.03 ($0.01 base + $0.02 for signatures)
Authentication
All API requests require an API key. Get yours from your account dashboard.
X-API-Key: your_api_key_here
Create Document from Template
https://www.bastiantechnologies.com/api/document-template/create
Request Body (JSON)
templateIdrecipientsprefillDataoptionsOptions Object
Configure document behavior with these options:
sendEmailsequentialSigningincludeCertificateexpirationDaysredirectUrlExample Request (cURL)
# Create document with 2 recipients and sequential signing
curl -X POST "https://www.bastiantechnologies.com/api/document-template/create" \
-H "X-API-Key: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"templateId": "your-template-uuid",
"prefillData": {
"employeeName": "John Doe",
"managerName": "Jane Smith",
"startDate": "2025-01-15"
},
"recipients": [
{ "name": "John Doe", "email": "john@example.com", "role": "signer1", "order": 1 },
{ "name": "Jane Smith", "email": "jane@example.com", "role": "signer2", "order": 2 }
],
"options": {
"sendEmail": true,
"sequentialSigning": true,
"includeCertificate": true,
"expirationDays": 14,
"redirectUrl": "https://yoursite.com/signed"
}
}'
Example Request (JavaScript)
// Create document with multiple recipients and all options
const response = await fetch('https://www.bastiantechnologies.com/api/document-template/create', {
method: 'POST',
headers: {
'X-API-Key': 'your_api_key_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({
templateId: 'your-template-uuid',
prefillData: {
employeeName: 'John Doe',
managerName: 'Jane Smith',
startDate: '2025-01-15'
},
recipients: [
{ name: 'John Doe', email: 'john@example.com', role: 'signer1', order: 1 },
{ name: 'Jane Smith', email: 'jane@example.com', role: 'signer2', order: 2 }
],
options: {
sendEmail: true, // Send signing emails
sequentialSigning: true, // Sign in order
includeCertificate: true, // Generate audit certificate
expirationDays: 14, // Expires in 14 days
redirectUrl: 'https://yoursite.com/signed'
}
})
});
const data = await response.json();
// Response:
// {
// success: true,
// documentId: "doc-uuid",
// signingLinks: [
// { name: "John Doe", email: "john@example.com", signUrl: "https://...", order: 1, canSign: true },
// { name: "Jane Smith", email: "jane@example.com", signUrl: "https://...", order: 2, canSign: false, waitingFor: "John Doe" }
// ],
// emailsSent: true,
// cost: 0.03,
// pricing: { documentFee: 0.01, recipients: 2, signatureFee: 0.02, total: 0.03 }
// }
Example Request (Python)
import requests
import json
# Create document with multiple recipients and all options
url = "https://www.bastiantechnologies.com/api/document-template/create"
headers = {
"X-API-Key": "your_api_key_here",
"Content-Type": "application/json"
}
payload = {
"templateId": "your-template-uuid",
"prefillData": {
"employeeName": "John Doe",
"managerName": "Jane Smith",
"startDate": "2025-01-15"
},
"recipients": [
{
"name": "John Doe",
"email": "john@example.com",
"role": "signer1",
"order": 1
},
{
"name": "Jane Smith",
"email": "jane@example.com",
"role": "signer2",
"order": 2
}
],
"options": {
"sendEmail": True, # Send signing emails
"sequentialSigning": True, # Sign in order
"includeCertificate": True, # Generate audit certificate
"expirationDays": 14, # Expires in 14 days
"redirectUrl": "https://yoursite.com/signed"
}
}
response = requests.post(url, headers=headers, json=payload)
data = response.json()
# Response:
# {
# "success": True,
# "documentId": "doc-uuid",
# "signingLinks": [
# {"name": "John Doe", "email": "john@example.com", "signUrl": "https://...", "order": 1, "canSign": True},
# {"name": "Jane Smith", "email": "jane@example.com", "signUrl": "https://...", "order": 2, "canSign": False, "waitingFor": "John Doe"}
# ],
# "emailsSent": True,
# "cost": 0.03,
# "pricing": {"documentFee": 0.01, "recipients": 2, "signatureFee": 0.02, "total": 0.03}
# }
Get Document Status
https://www.bastiantechnologies.com/api/document-template/status/{documentId}
Returns the current status of a document including signature progress.
List Templates
https://www.bastiantechnologies.com/api/document-template/templates
Returns all templates belonging to your account.
Get Template Details
https://www.bastiantechnologies.com/api/document-template/template/{templateId}
Returns details of a specific template including field definitions and recipients.
List Documents
https://www.bastiantechnologies.com/api/document-template/documents
Returns all document instances created from your templates with status information.
Get Document Details
https://www.bastiantechnologies.com/api/document-template/document/{documentId}
Returns full details of a document including recipients, signatures, and audit trail.
Send Signature Reminder
https://www.bastiantechnologies.com/api/document-template/remind/{documentId}
Sends reminder emails to recipients who haven't signed yet. Optional recipientEmail parameter to send to specific recipient.
Download Signed Document
https://www.bastiantechnologies.com/api/document-template/download/{documentId}
Success: Returns the signed PDF file (application/pdf)
Note: Only available after all signatures are completed
Webhooks
Configure a webhook URL on your template to receive real-time notifications when document events occur. Perfect for integrating with n8n, Zapier, or your own backend.
Configure Webhook on Template
Add webhookUrl when creating or updating a template:
{
"name": "Employment Contract",
"pdfFilePath": "...",
"fields": [...],
"webhookUrl": "https://your-n8n.app.n8n.cloud/webhook/abc123",
"webhookEvents": ["signed", "completed"]
}
Available Events
signed // A recipient signed their portion
completed // All recipients have signed
Webhook Payload
When an event occurs, we POST this JSON to your webhook URL:
{
"event": "document.completed",
"timestamp": "2025-12-08T21:00:00.000Z",
"documentId": "uuid-here",
"documentName": "John Doe Employment Contract",
"templateId": "uuid-here",
"status": "completed",
"recipients": [
{
"name": "John Doe",
"email": "john@example.com",
"status": "signed",
"signedAt": "2025-12-08T20:30:00Z"
}
],
"downloadUrl": "https://...?token=..."
}
n8n Tip: Add a Webhook trigger node in n8n, copy the URL, and paste it as your template's webhookUrl.
Your workflow will trigger automatically when documents are signed!
n8n Workflow Examples
Integrate document templates into your n8n automation workflows. Documents are created instantly with status pending. The status tracks signature collection progress (pending â completed).
1. Create Document from Template
Use an HTTP Request node with these settings:
// HTTP Request Node Configuration
Method: POST
URL: https://www.bastiantechnologies.com/api/document-template/create
// Headers
Authorization: Bearer {{ $credentials.bastianApiToken }}
Content-Type: application/json
// Body (JSON)
{
"templateId": "your-template-id-here",
"recipients": [
{
"role": "signer1",
"name": "{{ $json.customerName }}",
"email": "{{ $json.customerEmail }}"
}
],
"fields": {
"contract_date": "{{ $now.format('yyyy-MM-dd') }}",
"amount": "{{ $json.amount }}"
}
}
Response: Document is created immediately. You'll receive the documentId which you can use to download or check status.
2. Check Document Status (Optional)
Poll the status to check signature progress:
// HTTP Request Node Configuration
Method: GET
URL: https://www.bastiantechnologies.com/api/document-template/status/{{ $json.documentId }}
// Headers
Authorization: Bearer {{ $credentials.bastianApiToken }}
// Response contains:
{
"success": true,
"status": "pending", // or "completed"
"signedCount": 1,
"totalCount": 2,
"recipients": [...]
}
3. Download Document
Download the PDF (works for pending or completed documents):
// HTTP Request Node Configuration
Method: GET
URL: https://www.bastiantechnologies.com/api/document-template/download/{{ $json.documentId }}
// Headers
Authorization: Bearer {{ $credentials.bastianApiToken }}
// Response Options
Response Format: File
Put Output in Field: data
// The response is binary PDF data
// Use "Write Binary File" node to save, or
// "Send Email" node to attach the PDF
Complete Workflow Example
Tip: Use a "Wait" node if you need signatures before download, or use webhooks to trigger when document is completed.
Response Format
{
"success": true,
"documentId": "doc-uuid-here",
"signUrl": "https://www.bastiantechnologies.com/sign/...",
"status": "pending",
"createdAt": "2024-11-23T10:30:00Z"
}
{
"success": false,
"error": "Template not found",
"code": "TEMPLATE_NOT_FOUND"
}