Skip to main content

API Playground

The API Playground is an interactive tool for testing the RenderDoc document generation API directly from your browser.

Overview

The API Playground allows you to:

  • Generate single PDF or Excel documents from templates
  • Generate batch documents (multiple documents at once)
  • Check the status of document generation jobs
  • Check the status of batch jobs
  • View code samples in 6 programming languages

Getting Started

Accessing the Playground

  1. Navigate to APIPlayground from the dashboard sidebar
  2. The playground opens with the default "Single Doc" tab selected

Prerequisites

Before using the playground, you'll need:

  • At least one API Key created in your account
  • At least one document template (PDF or Excel)

Interface Layout

The playground has a simple two-panel layout:

Tab Navigation

Four tabs at the top let you switch between modes:

TabIconDescription
Single Doc📄Generate a single document
Batch📑Generate multiple documents at once
Job Status🔍Check status of a single document job
Batch Status⏱️Check status of a batch job

Request Panel (Left)

Configure your API request:

  • API Key: Select which API key to use
  • Template: Choose a document template
  • Format: Select PDF or Excel output
  • Variables: Edit template variable values
  • Filename: Optional custom filename
  • Options: Draft mode, premium credits

Response Panel (Right)

View the API response:

  • Success or error status
  • JSON response data
  • Job ID or batch ID for status checking
  • Download link for completed documents

Code Samples (Bottom)

Auto-generated code samples that update as you configure your request.


Generating a Single Document

Step 1: Select API Key

Choose an API key from the dropdown. If you don't have one, create one in Settings → API Keys.

Step 2: Select Template

Choose a document template from the dropdown. Templates are filtered to show only attachment templates (PDF/Excel).

Step 3: Choose Output Format

Select your desired output format:

  • PDF - Generates a PDF document
  • Excel - Generates an Excel spreadsheet (.xlsx)

Step 4: Configure Variables

If your template has variables, click Edit Variables to open the variable editor. Fill in values for each variable defined in the template.

Step 5: Optional Settings

  • Filename: Specify a custom filename (e.g., invoice-2024.pdf)
  • Use Draft Version: Generate from the draft template instead of published version
  • Use Premium Credits: For Free tier users with credits, generate without watermark

Step 6: Generate

Click Generate Document to submit the request.

Response

A successful response includes:

{
"jobId": "job_abc123xyz",
"status": "completed",
"downloadUrl": "https://storage.renderdoc.dev/...",
"filename": "invoice-2024.pdf",
"format": "pdf",
"creditsUsed": 1
}

Generating Batch Documents

Batch generation lets you create multiple documents from the same template with different variable values.

Step 1: Configure Base Settings

Same as single document: select API key, template, and format.

Step 2: Add Documents

Click Add Document to add documents to the batch. Each document can have:

  • Its own set of variable values
  • An optional custom filename

Step 3: Generate Batch

Click Generate Batch to submit. The response includes a batch ID for tracking:

{
"batchId": "batch_xyz789",
"status": "processing",
"totalDocuments": 5,
"completedDocuments": 0
}

Checking Job Status

Use the Job Status tab to check the status of a document generation job.

How to Use

  1. Enter a job ID (e.g., job_abc123xyz)
  2. Click Check Status

Response

{
"jobId": "job_abc123xyz",
"status": "completed",
"downloadUrl": "https://storage.renderdoc.dev/...",
"createdAt": "2024-01-15T10:30:00Z",
"completedAt": "2024-01-15T10:30:05Z"
}

Job Statuses

StatusDescription
pendingJob is queued for processing
processingDocument is being generated
completedDocument is ready for download
failedGeneration failed (check error message)

Checking Batch Status

Use the Batch Status tab to check the status of a batch job.

Response

{
"batchId": "batch_xyz789",
"status": "completed",
"totalDocuments": 5,
"completedDocuments": 5,
"failedDocuments": 0,
"documents": [
{
"jobId": "job_1",
"status": "completed",
"downloadUrl": "..."
}
]
}

Code Samples

The playground automatically generates code samples in 6 languages based on your current configuration.

Available Languages

LanguageLibrary Used
cURLCommand line
JavaScriptaxios
Pythonrequests
PHPcURL
Rubynet/http
Gonet/http

Using Code Samples

  1. Configure your request in the playground
  2. Scroll down to the Code Samples section
  3. Click on the language tab you want
  4. Click Copy to copy the code
  5. Paste into your application

Example: JavaScript

const axios = require('axios');

const API_KEY = 'rd_sk_your_api_key';
const API_ENDPOINT = 'https://api.renderdoc.dev/api';

async function generateDocument() {
try {
const response = await axios.post(`${API_ENDPOINT}/v1/documents/generate`, {
templateId: 'your-template-id',
format: 'pdf',
variables: {
customerName: 'Acme Corp',
invoiceNumber: 'INV-001'
}
}, {
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${API_KEY}`
}
});

console.log('Response:', response.data);
return response.data;
} catch (error) {
console.error('Error:', error.response?.data || error.message);
throw error;
}
}

generateDocument();

Example: Python

import requests

API_KEY = 'rd_sk_your_api_key'
API_ENDPOINT = 'https://api.renderdoc.dev/api'

def generate_document():
url = f'{API_ENDPOINT}/v1/documents/generate'
headers = {
'Content-Type': 'application/json',
'Authorization': f'Bearer {API_KEY}'
}

payload = {
'templateId': 'your-template-id',
'format': 'pdf',
'variables': {
'customerName': 'Acme Corp',
'invoiceNumber': 'INV-001'
}
}

response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()
return response.json()

if __name__ == '__main__':
result = generate_document()
print('Response:', result)

API Endpoints Used

The playground uses these document API endpoints:

EndpointMethodDescription
/v1/documents/generatePOSTGenerate single document
/v1/documents/generate/batchPOSTGenerate batch of documents
/v1/documents/jobs/:jobIdGETCheck job status
/v1/documents/batches/:batchIdGETCheck batch status

Options Reference

Use Draft Version

When enabled, the document is generated using the draft version of the template instead of the published version. Useful for testing template changes before publishing.

Use Premium Credits

Available only for Free tier users who have purchased credit packs. When enabled:

  • Document is generated without watermark
  • One credit is deducted from your credit balance

When disabled (Free tier):

  • Document includes a RenderDoc watermark
  • No credits are deducted

Common Questions

Why don't I see any templates?

The playground only shows attachment templates (PDF/Excel). Make sure you have at least one attachment template created.

Why is the Generate button disabled?

You need to:

  1. Select an API key
  2. Select a template
  3. (For batch) Add at least one document

How do I test with different variable values?

Click Edit Variables to open the variable editor. You can modify values for all variables defined in the template.

Can I save my test configurations?

Currently, the playground doesn't save configurations between sessions. Use the generated code samples to save your test setup.

Are playground requests counted against my quota?

Yes, documents generated through the playground count as regular API usage and are deducted from your quota or credits.


What's Next?


Need help? Contact [email protected]