Skip to main content

Debug Mode

Debug Mode helps you quickly troubleshoot why a template didn’t render as expected, without guessing. Use it while building or debugging; turn it off for production runs. It only works on the PDF from templates endpoints.

What you get with Debug Mode

When debug is enabled, the response includes:
  • Rendered HTML – the final HTML string sent to the PDF engine.
  • Sent Variables – the exact payload received by the template.
  • Template Schema – variables the template expects (including each arrays).
  • Are Variables Valid? – If the schema from sent variables equals template schema.
  • Missing Variables – list of required variables not provided on the payload
  • Has Draft Version – If there’s a draft version of this template that has not been published yet (The API only has access to published versions)
Performance note: Debug Mode adds extra work and slows down the request. Use it only for investigation.

How to activate Debug Mode

Just add debug: true to your request body. Example of request:
curl --location 'https://api.pdfnoodle.com/v1/pdf/sync' \
--header 'Authorization: Bearer pdfnoodle_api_123456789' \
--header 'Content-Type: application/json' \
--data '{
    "templateId": "check",
    "debug": true,
    "data":{
            "currentDDate": "01/12/2025",
            "user": {
                    "name":"John Doe",
                    "email": "[email protected]"
            },
            "details": [{"score":"100", "description":"high score"}]
    }
}
'
On your response, you’ll get an additional object with the debug information:
{
    "signedUrl": "https://pdforge-production.s3.us-east-2.amazonaws.com/...",
    "metadata": {
        "executionTime": "1.805 seconds",
        "fileSize": "4.066 kB"
    },
    "debug":{
    	"renderedHtml": "<!html>....",
	"templateSchema": {...},
	"sentVariables": {...},
	"isVariablesValid": true,
	"missingVariables": [...],
	"hasDraftVersion": true
    }
}