Skip to main content

API Quick Start

Welcome to the Re:port Flow API!

Re:port Flow is a Japan-built PDF generation service with native Japanese typesetting, callable from both a REST API and an MCP server, with a free plan (up to 30 PDF pages per month) to start on. This guide will help you generate PDFs in 5 minutes.

⚡ How do I generate a PDF in 5 minutes?​

Grab two values — your application key and a template ID — then POST them to /v1/file/sync/single. Preparing those in the admin console takes about two minutes, and the first PDF comes back from a single cURL call in about three. Work through the steps below in order.

Don't have an account yet?

You need a Re:port Flow account to get an API key. Sign up for free before you begin.

Step 1: Get API Keys (1 minute)​

Access the Re:port Flow admin panel and get the following information:

  1. Navigate to Workspace Settings → API Keys
  2. Copy the Application Key (appkey) — used as the appkey HTTP header.
tip

Authentication uses a single appkey header (lowercase). Store the value securely.

Step 2: Check Template ID (1 minute)​

  1. Go to Design Management
  2. Select the template you want to use
  3. Copy the Template ID (e.g., 0eUDdgAjNXrrItA2 — a 16-character alphanumeric string, not a UUID)

Step 2.5: Check Parameter Structure (1 minute, Optional)​

Check the parameter structure required by the template:

curl -X GET https://api.re-port-flow.com/v1/file/design/parameter/0eUDdgAjNXrrItA2 \
-H "appkey: your-app-key"

Response example:

[
{ "name": "customerName", "type": "text", "label": "Customer name" },
{ "name": "invoiceNumber", "type": "text", "label": "Invoice number" },
{ "name": "amount", "type": "number", "label": "Amount" }
]

The response is an array of parameter definitions. name is the key you send in params when generating a PDF; label is a display name. Some templates use non-ASCII keys (for example Japanese such as "顧客名"), so always use the name value exactly as returned.

tip

For details on parameter structure, see the Template Parameters Guide.

Step 3: Generate Your First PDF (3 minutes)​

Run the following cURL command in your terminal:

curl -X POST https://api.re-port-flow.com/v1/file/sync/single \
-H "Content-Type: application/json" \
-H "appkey: your-app-key" \
-d '{
"designId": "0eUDdgAjNXrrItA2",
"version": 1,
"content": {
"fileName": "invoice.pdf",
"params": {
"customerName": "John Doe",
"invoiceNumber": "INV-2024-001",
"amount": 10000
}
}
}' \
--output my-first-pdf.pdf
success

On success, my-first-pdf.pdf will be saved to the current directory!

🎯 What is the Re:port Flow API used for?​

Three patterns cover most integrations: letting a user download a PDF the moment they click a button, generating a PDF for every customer at month-end and emailing them, and showing a preview before anything is saved. Each one below names the endpoint it uses, so start from whichever is closest to your case.

Use Case 1: Instant Invoice Generation​

Generate and download PDFs instantly when users click a button.

Endpoint: Sync Single PDF Generation

In this example the browser calls your server, and your server calls the Re:port Flow API.

// Your server (the appkey lives only here). generatePDF is the Sync Single PDF Generation sample (its `data` is the PDF body)
app.get('/api/invoices/:id/pdf', requireLogin, async (req, res) => {
// Check that the signed-in user may see this invoice (never serve someone else's ID)
if (!(await canViewInvoice(req.user, req.params.id))) return res.status(404).end();
const pdf = await generatePDF({
designId: 'invoice-template',
version: 1,
fileName: `invoice_${req.params.id}.pdf`,
data: await getInvoiceData(req.params.id)
});

res.setHeader('Content-Type', 'application/pdf');
res.setHeader('Content-Disposition', `attachment; filename="invoice_${req.params.id}.pdf"`);
res.send(pdf.data);
});

// Browser: on button click, open your server's URL
function downloadInvoice(invoiceId) {
window.location.href = `/api/invoices/${invoiceId}/pdf`;
}

Use Case 2: Bulk Monthly PDF Generation​

Generate PDFs for all customers at month-end and send via email.

Endpoint: Async Multiple PDF Generation

// Batch processing
async function generateMonthlyReports(customers) {
const contents = customers.map(customer => ({
fileName: `report_${customer.id}.pdf`,
params: customer.data
}));

const result = await generateMultiplePDFsAsync('report-template', contents);

// Send emails to each customer
await sendEmailsWithPDFs(result);
}

Use Case 3: Preview Feature​

Real-time preview in template editor.

Endpoint: Sync Single PDF Generation

// Your server (the appkey lives only here). generatePDF is the Sync Single PDF Generation sample (its `data` is the PDF body)
// Relaying designId / params without authentication hands the appkey's power to anyone.
// Always require your own login (requireLogin) and an allow-list of accepted designIds.
const PREVIEW_DESIGN_IDS = new Set(['0eUDdgAjNXrrItA2']);

app.post('/api/preview', requireLogin, async (req, res) => {
if (!PREVIEW_DESIGN_IDS.has(req.body.designId)) return res.status(400).end();
const pdf = await generatePDF({
designId: req.body.designId,
version: 1,
fileName: 'preview.pdf',
data: req.body.params
});

res.setHeader('Content-Type', 'application/pdf');
res.send(pdf.data);
});

// Browser: on preview button click
async function showPreview(designId, params) {
const res = await fetch('/api/preview', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ designId, params })
});
const url = URL.createObjectURL(await res.blob());
window.open(url, '_blank');
}

🧭 API Overview​

PDF Generation Endpoints​

EndpointPurposeTimeoutResponse
POST /file/sync/singleSync single PDF60 secPDF file
POST /file/async/singleAsync single PDFNoneURL + fileId
POST /file/sync/multipleSync multiple PDFs60 secZIP file
POST /file/async/multipleAsync multiple PDFsNoneURL + fileId

Other Endpoints​

EndpointDescription
GET /file/status/{requestId}Generation request status (for polling async generation)
GET /file/download/{requestId}Bulk ZIP download
GET /file/download/{requestId}/{fileId}Individual PDF download
GET /file/design/parameter/{designId}Get design parameters
GET /file/designsList the templates in the workspace (30 per page; ID, name, latest version, and more)

🧪 Try in Postman​

If you want to try the API right away, use our official Postman collection:

Postman Public Workspace​

Run in Postman

The official Postman collection includes:

  • ✅ Runnable requests for the main endpoints
  • ✅ Automatic application-key authentication
  • ✅ Realistic sample parameters
  • ✅ Auto-test scripts for response validation
  • ✅ Error-case samples (412, 401, 400)

For a collection that covers every endpoint, import https://doc.re-port-flow.com/openapi/content-service.postman_collection.json into Postman. It is generated from the OpenAPI specification and updated together with it.

📚 Next Steps​

🔧 Limitations​

See the Limitations page for the full list.

  • Request Size: Maximum 50MB (Base64-encoded; ~37MB raw equivalent)
  • File Name: Anything except / \\ : * ? " < > | and control characters is allowed
  • Authentication: appkey header (lowercase) required on every request

💡 Sample Code​

JavaScript (Node.js)​

const axios = require('axios');

async function generatePDF() {
const response = await axios.post(
'https://api.re-port-flow.com/v1/file/sync/single',
{
designId: '0eUDdgAjNXrrItA2',
version: 1,
content: {
fileName: 'invoice.pdf',
params: {
customerName: 'John Doe',
invoiceNumber: 'INV-2024-001',
amount: 10000
}
}
},
{
headers: {
'appkey': 'your-app-key'
},
responseType: 'arraybuffer'
}
);

return response.data;
}

Python​

import requests

def generate_pdf():
url = 'https://api.re-port-flow.com/v1/file/sync/single'
headers = {
'appkey': 'your-app-key',
'Content-Type': 'application/json'
}
data = {
'designId': '0eUDdgAjNXrrItA2',
'version': 1,
'content': {
'fileName': 'invoice.pdf',
'params': {
'customerName': 'John Doe',
'invoiceNumber': 'INV-2024-001',
'amount': 10000
}
}
}

response = requests.post(url, headers=headers, json=data)
return response.content

Integrations​

You can call Re:port Flow without writing API code directly. The comparison table in the Integration Overview helps you pick one:

🆘 Support​

For questions or support, please contact: