Skip to content
v1

API Reference

Render templates, manage assets, and integrate PDF generation into any stack.

Overview

The PDF Report Studio API lets you render templates to PDFs, manage your template library, and retrieve generation logs — all over HTTPS with JSON request bodies and standard HTTP status codes.

Base URL https://api.pdfreport.studio
Auth Bearer token — see Authentication
Format JSON request body. PDF render returns application/pdf

Authentication

All API requests require a bearer token. Create and manage API keys from Settings → API Keys in your dashboard. Keys are shown once on creation — store them securely.

Key format

Keys are prefixed with prs_ and scoped to your organization.

cURL
curl https://api.pdfreport.studio/api/templates \
-H "Authorization: Bearer prs_your_api_key"
POST /api/templates/:id/render

Render PDF

Compiles the specified template with the provided data payload and returns a binary PDF. Data is validated against the template's schema before rendering.

Path parameters

Parameter Type Description
id string Template ID (required)

Request body

Field Type Description
data object Key-value pairs matching the template's schema. Required.

Response

Returns Content-Type: application/pdf on success. On error, returns JSON with an error object.

const response = await fetch(
`https://api.pdfreport.studio/api/templates/${templateId}/render`,
{
method: 'POST',
headers: {
'Authorization': `Bearer ${API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
data: {
company: 'Acme Corp',
items: [
{ name: 'Consulting', qty: 3, price: 150 },
],
due_date: '2025-06-01',
}
}),
}
);

const pdf = await response.arrayBuffer();
GET /api/templates

List templates

Returns all templates visible to the authenticated user — their own drafts and their organization's published templates.

Response
[
{
"id": "tmpl_abc123",
"name": "Invoice v3",
"description": "Standard invoice with line items",
"status": "published",
"createdAt": "2025-03-12T10:24:00Z",
"updatedAt": "2025-04-01T08:15:00Z"
}
]
GET /api/templates/:id

Get template

Returns a single template's metadata, schema definition, and sample data. Use the schema field to know which keys your data payload must include when rendering.

Response
{
"id": "tmpl_abc123",
"name": "Invoice v3",
"status": "published",
"schema": {
"type": "object",
"properties": {
"company": { "type": "string" },
"due_date": { "type": "string", "format": "date" },
"items": { "type": "array" }
}
},
"sampleData": { /* ... */ }
}
GET /api/logs

Generation logs

Returns a paginated list of PDF generation events for your organization. Useful for auditing, debugging, and tracking usage.

Query parameters

Parameter Type Description
limit integer Max results to return (default: 50)
offset integer Pagination offset
status string Filter by status: success or error
source string Filter by source: api, ui, or mcp
templateId string Filter by specific template
search string Full-text search on template name
from string (ISO 8601) Start of time range
to string (ISO 8601) End of time range

Errors

All errors return a JSON body with a top-level error object.

{
"error": {
"code": "schema_validation_failed",
"message": "Missing required field: company"
}
}
Status Code Description
400 invalid_request Missing or malformed request parameters
401 unauthorized Missing or invalid API key
404 not_found Template not found or not accessible
422 schema_validation_failed Data payload doesn't match the template schema
429 rate_limited Request rate exceeded — see Rate Limits
500 render_failed Internal rendering error

Rate limits

Rate limits apply per API key, per minute. When a limit is exceeded, the API returns a 429 status. Check the response headers to determine when you can retry.

Plan Requests / min
Free 10
Pro 300
Enterprise Custom

Rate limit headers

Header Description
X-RateLimit-Limit Maximum requests allowed per minute
X-RateLimit-Remaining Requests remaining in the current window
X-RateLimit-Reset Unix timestamp when the window resets

API keys

API keys are scoped to your organization and grant access to all templates your organization can see. Keys are prefixed with prs_ and displayed only once on creation — copy them immediately and store them in a secret manager or environment variable.

Manage your API keys from Settings → API Keys in the dashboard. You can create multiple keys for different environments and revoke them individually.