The API · v1

Build with BulkRender.

A REST API and an MCP server. Render thousands of docs from your code, your AI agent, or your CRM in three lines.

Auth

Authentication

All API requests require a platform API key sent in the X-API-Key header. API access is available on the Pro plan and above.

Create and manage keys in Settings, Platform API Keys.

Keys use the format br_live_.... The full key is shown only once at creation time. Store it securely.

$ Example request header
curl -X POST https://api.bulkrender.com/api/documents/generate \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_MCP_TOKEN_HERE"
Endpoint

Generate Single Document

POST /api/documents/generate

Generate a single document from a template. Pass the template ID and a data object with key-value pairs matching your template variables.

Request Body

Field Type Required Description
templateId string (uuid) Yes Template to generate from
data object Yes Key-value pairs for template variables. For loop blocks, use arrays of objects.
outputFormat string No "docx" (default, 1 credit) or "pdf" (2 credits)
name string No Custom filename. Auto-generated if omitted.
recipientEmailField string No Field name in data containing recipient email for auto-delivery. Defaults to "email".
$ Example request
curl -X POST https://api.bulkrender.com/api/documents/generate \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{
    "templateId": "c5f2e8a1-...",
    "data": {
        "name": "John Doe",
        "company": "Acme Inc",
        "items": [
            { "product": "Widget", "quantity": "10", "price": "$9.99" }
        ]
    },
    "outputFormat": "docx"
}'
$ Example response (201)
{
  "status": "success",
  "data": {
    "id": "d4e5f6a7-...",
    "name": "Invoice - John Doe",
    "file_type": "docx",
    "file_size": 24832,
    "downloadUrl": "https://s3.amazonaws.com/your-bucket/docs/Invoice-John-Doe.docx?X-Amz-Expires=3600&...",
    "created_at": "2026-05-17T10:30:00.000Z",
    "expires_at": "2026-06-16T10:30:00.000Z"
  }
}
Tip: The downloadUrl in the response is a signed download link that expires in 1 hour. The underlying file remains stored for your plan's retention period. Call GET /documents/:id again to get a fresh URL.
Endpoint

Generate Batch

POST /api/documents/generate-batch

Generate multiple documents from the same template. Each record in the array produces one document. The result is a downloadable ZIP archive.

Request Body

Field Type Required Description
templateId string (uuid) Yes Template to generate from
records array Yes Array of data objects, one per document
outputFormat string No "docx" (default) or "pdf"
recipientEmailField string No Field name for per-record email delivery

Batch Size Limits

Plan Max Records per Batch
Pro 100
Enterprise 500
Custom 1,000
$ Example request
curl -X POST https://api.bulkrender.com/api/documents/generate-batch \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{
    "templateId": "c5f2e8a1-...",
    "records": [
        { "name": "Alice Smith", "email": "alice@example.com" },
        { "name": "Bob Jones", "email": "bob@example.com" }
    ],
    "outputFormat": "docx",
    "recipientEmailField": "email"
}'
$ Example response (201)
{
  "status": "success",
  "data": {
    "batchId": "b8c9d0e1-...",
    "downloadUrl": "https://s3.amazonaws.com/your-bucket/batches/batch-b8c9d0e1.zip?X-Amz-Expires=3600&...",
    "count": 2,
    "totalSize": 49152,
    "documents": [
      { "name": "Alice Smith", "key": "...", "size": 24576 },
      { "name": "Bob Jones", "key": "...", "size": 24576 }
    ],
    "deliverySummary": { "sent": 2, "failed": 0, "skipped": 0 }
  }
}
Output

Response Format

All API responses follow a consistent JSON structure.

Success

{ "status": "success", "data": { ... } }

Error

{ "status": "error", "message": "Description of what went wrong" }

Credit Usage Headers

Generation endpoints return credit information in response headers:

Header Description
X-Credits-Used Credits consumed by this request
X-Credits-Remaining Credits remaining after this request
Errors

Error Handling

The API uses standard HTTP status codes. Errors always return a JSON body with status: "error" and a message field.

Code Meaning Common Causes
400 Bad Request Missing templateId or data, data payload too large (>1MB), batch size exceeds plan limit
401 Unauthorized Missing X-API-Key header, invalid or expired API key
403 Forbidden Insufficient credits, permission denied (role too low)
429 Too Many Requests Rate limit exceeded (30 requests/minute)
500 Server Error Internal error during document generation
$ Example error response
HTTP/1.1 403 Forbidden

{
  "status": "error",
  "message": "Insufficient credits. You need 2 credits for PDF. You have 0 credits."
}
Limits

Rate Limits & Credits

Rate Limits

API requests are rate-limited to 30 requests per minute per organization. The limit applies across all API keys in your organization.

Rate limit headers are included in every response: RateLimit-Limit, RateLimit-Remaining, RateLimit-Reset.

Credits

Each document generation costs credits based on format:

Format Cost Notes
docx 1 credit Native Word format
pdf 2 credits Includes DOCX generation + PDF conversion

For batch requests, total credits = number of records × credit cost per format. Example: 50 PDF documents = 100 credits.

Plan credits: Pro plans start with 1,000 credits/month. Enterprise plans start with 100,000. Additional credit packs can be purchased anytime.
Safety

Idempotency

To safely retry requests without generating duplicate documents, include an Idempotency-Key header with a unique value (e.g., a UUID).

If the same key is sent again within 24 hours, the API returns the original response instead of generating a new document. No additional credits are charged.

$ Example with idempotency key
curl -X POST https://api.bulkrender.com/api/documents/generate \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Idempotency-Key: 550e8400-e29b-41d4-a716-446655440000" \
  -d '{ "templateId": "c5f2e8a1-...", "data": { "name": "John Doe" } }'
Best practice: Always use idempotency keys for production integrations, especially for batch generation and any requests triggered by webhooks or automated pipelines.
MCP

For AI Agents

BulkRender ships a native MCP server so you can generate documents directly from Claude, Cursor, Windsurf, Cline, or any MCP-compatible assistant. No API calls, no boilerplate — just ask.

Prerequisites

Get your MCP URL

Go to Settings, Integrations, open the AI Assistants section, and click Generate MCP URL. Copy it immediately — it is only shown once.

Connect: Claude Desktop / Cursor / Windsurf / Cline

Add to your app's MCP config file. Paste your MCP URL directly — no environment variables needed:

$ mcpServers config (JSON)
{
  "mcpServers": {
    "bulkrender": {
      "url": "https://mcp.bulkrender.com/mcp/YOUR_MCP_URL"
    }
  }
}

Connect: Claude.ai

Go to Settings, Integrations, Add MCP and paste your MCP URL.

Connect: Claude Code (CLI)

$ Terminal
claude mcp add bulkrender --scope user -- npx mcp-remote YOUR_MCP_URL

Verify: claude mcp list should show bulkrender ✓ Connected

Available Tools

Tool Description Credits
list_templates List all templates with their variable schemas 0
get_template Get template details and variable schema 0
generate_document Generate a single document (DOCX or PDF) 1-2
generate_batch Generate documents for multiple records (up to 500) 1-2 each
check_credits Check remaining credits 0
refresh_document_url Get a fresh signed download URL for an existing document 0
create_template_from_docx Create a reusable template from a DOCX URL 0
submit_feedback Report feature requests or issues to the support team 0

DOCX = 1 credit. PDF = 2 credits. Rate limit: 30 requests/min per organisation.

Walk-in Tools (no account required)

Agents with no BulkRender account can generate documents and pay per session. Connect using the public MCP URL — no API key needed:

Public MCP URL (no account)
https://mcp.bulkrender.com/mcp/acp
Tool Description Cost
acp_list_public_templates List 5 built-in templates (invoice, quote, contract, report, proposal) with field names Free
acp_create_session Create a checkout session. Pass records[] with one data object per document. Returns checkout_url for browser payment -
acp_get_session Poll until completed. Returns download_url per doc and zip_download_url (24h expiry) Free
submit_feedback Report feature requests or issues to the support team Free

Pricing: $0.10/credit. DOCX = 1 credit, PDF = 2 credits. Minimum charge $1.00 (covers up to 10 DOCX or 5 PDF docs). Unused credit is yours if you sign up.

Usage Examples

  • "List my BulkRender templates"
  • "Generate an invoice using the Invoice Template for Acme Corp, invoice #1234, dated 2025-01-15, amount $5,000"
  • "Generate invoices for these 3 clients: Acme Corp ($5,000), Beta Inc ($3,200), Gamma LLC ($7,800)"
  • "How many BulkRender credits do I have left?"

The assistant calls list_templates to find the template, then generate_document or generate_batch, and returns a signed download URL valid for 1 hour.

Machine-Readable Resources