Microsoft Power Automate
Prerequisites
- A PolyDoc account and API key - sign up for free, no credit card required. The free plan includes 150 PDF conversions per month.
- A Microsoft Power Automate account with Power Automate Premium (or the free 90-day Premium trial). The PolyDoc call uses the HTTP action and the Request / Response connectors, which are premium - see the note below.
Generate a PDF from an HTTP request
Expose a Power Automate cloud flow as an HTTP endpoint, forward the request to PolyDoc, and return the rendered PDF in the response - a serverless "HTML/template → PDF" microservice you can call from any app, Power App, or another flow.When an HTTP request is received (trigger) → HTTP (call PolyDoc) → Response (return the PDF)
Create an instant flow with an HTTP request trigger
In Power Automate choose Create → Instant cloud flow, then pick the When an HTTP request is received trigger (from the Request connector). Leave Who can trigger the flow? on Any user in my tenant. The endpoint HTTP URL is generated when you first save the flow - copy it then; it carries a signed sig token, so treat it as a secret.
Add the HTTP action that calls PolyDoc
Click + below the trigger, search HTTP, and add the HTTP action. Configure it to call PolyDoc:
- URI:
https://api.polydoc.tech/pdf/convert - Method:
POST - Headers:
Authorization=Bearer YOUR_API_KEY,Content-Type=application/json,X-Sandbox=true - Body: the JSON below
{
"source": "[template:YOUR_TEMPLATE_ID]",
"templateData": {
"invoice_number": "INV-2026-001",
"invoice_date": "2026-01-15",
"invoice_due_date": "2026-02-14",
"invoice_subtotal": 1200,
"invoice_tax_rate": 0.1,
"invoice_tax_amount": 120,
"invoice_total": 1320,
"customer_name": "John Doe",
"customer_email": "john.doe@example.com",
"customer_street": "456 Customer Avenue",
"customer_city": "Beautiful City",
"customer_country": "UK",
"items": [
{"quantity": 1, "name": "Web Design Services", "description": "Custom website design and development for company homepage", "price": 800},
{"quantity": 1, "name": "Logo Design", "description": "Professional logo design with 3 revision rounds", "price": 300},
{"quantity": 1, "name": "SEO Optimization", "description": "Search engine optimization for 10 target keywords", "price": 100, "original_price": 150}
]
}
}
Replace YOUR_API_KEY with the key from the Dashboard and YOUR_TEMPLATE_ID with your template short ID from the Dashboard Templates page (e.g. a1b-c2d).
Return the PDF in the response
Add a Response action (from the Request connector) after the HTTP action so the caller gets the PDF back:
- Status Code:
200 - Headers:
Content-Type=application/pdf - Body: the Body dynamic-content token from the HTTP step (expression
body('HTTP'))
Save and test the endpoint
Save the flow. The flow checker should show "Your flow is ready to go" with no errors (if it instead flags a license warning, enable Premium - see the note at the top). Copy the trigger's HTTP URL and POST to it to get a PDF back:
curl -X POST '<your-flow-http-url>' \
-H 'Content-Type: application/json' \
--data-raw '{}' \
--output invoice.pdf
Open invoice.pdf - it's the rendered template with the SANDBOX watermark while the X-Sandbox header is set. Every run is also listed under the flow's 28-day run history, where you can inspect the HTTP action's inputs and outputs.