Skip to main content
We recommend using asynchronous requests for better performance on your application.
POST https://api.pdfnoodle.com/v1/pdf/sync

Request

curl --location 'https://api.pdfnoodle.com/v1/pdf/sync' \
--header 'Authorization: Bearer pdfnoodle_api_123456789' \
--header 'Content-Type: application/json' \
--data '{
    "templateId": "check",
    "data": {
        "currentDDate": "01/12/2025",
        "user": {
            "name": "John Doe",
            "email": "[email protected]"
        },
        "details": [{"score": "100", "description": "high score"}]
    }
}'

Response

{
  "signedUrl": "https://pdforge-production.s3.us-east-2.amazonaws.com/...",
  "metadata": {
    "executionTime": "1.805 seconds",
    "fileSize": "4.066 kB"
  }
}
This endpoint responds with 200 OK once the PDF has been generated. The response body will contain a signedUrl key which is a temporary URL pointing to the generated PDF file on our S3 bucket. If you passed a custom s3_bucket, it’ll be stored there instead. This URL will expire after 1 hour. If your PDF takes more than 30 seconds to render, it will automatically be added to an asynchronous queue and you’ll receive a 202 Accepted response with a requestId. You can check the status using the Get PDF Status endpoint.

PDF Render Metadata

We’ll also bring some additional metadata from your PDF render with every response:
  • executionTime - Time in seconds it took to generate your PDF
  • fileSize - PDF size in kiloBytes

Parameters

templateId
string
required
The id of your PDF template
data
object
required
The object containing the variables from your PDF template
convertToImage
boolean
If true, will return a .PNG file instead of a .PDF file (default: false)
metadata
object
This object containing the metadata for your PDF. See all the options here.
s3_bucket
string
The id of the active s3 connection you want to store your generated file on. (only available in the high plan)
s3_key
string
The path, including subdirectories and the filename without extension, to use when saving the render in your S3 bucket. (only available if being stored in custom s3_bucket)
externalId
string
If you’re using our embedded white-label solution, you can pass the UUID of your customer to generate the PDF of the customized template
hasCover
boolean
If true, will hide the footer and the header elements on the first page of the generated PDF. (default: false)
debug
boolean
If true, will enter Debug Mode and show additional properties on the response to help you figure out your variables and html rendered content. Here’s everything you need to know about Debug Mode. (default: false)

Request Timeout (>30 seconds)

Synchronous requests are useful when you want to get the results back immediately. However, if your PDF takes more than 30 seconds to render, it will automatically be added to an asynchronous queue.
Sometimes, your PDF might take more than 30 seconds to render, if it has a lot of heavy images/charts and a lot of pages being generated. If that’s the case and your PDF takes more than 30 seconds to render synchronously, we’ll automatically add it to an asynchronous queue to render it. You’ll be able to check if the PDF is completed using the Get PDF Status endpoint with the requestId you just received (or just by making a GET request on the statusUrl). If the PDF is still rendering, you’ll get a response like this:
{
  "requestId": "pdfnoodle_request_123456789",
  "renderStatus": "ONGOING",
  "signedUrl": "",
  "metadata": {}
}
And once the PDF is ready, you’ll receive a response like this:
{
  "requestId": "pdfnoodle_request_123456789",
  "renderStatus": "SUCCESS",
  "signedUrl": "https://pdforge-production.s3.us-east-2.amazonaws.com/...",
  "metadata": {
    "executionTime": "1.805 seconds",
    "fileSize": "4.066 kB"
  }
}