Skip to main content
POST https://api.pdfnoodle.com/v1/html-to-pdf/async

Request

curl --location 'https://api.pdfnoodle.com/v1/html-to-pdf/async' \
--header 'Authorization: Bearer pdfnoodle_api_123456789' \
--header 'Content-Type: application/json' \
--data '{
    "html": "<html><body><h1>Your HTML here!</h1></body></html>",
    "webhook": "https://webhook.url"
}'

Response

{
  "requestId": "pdfnoodle_request_123456789"
}
This endpoint responds with 200 OK immediately with a requestId. After a few seconds, the PDF file will be generated and we will send a POST to your webhook with the response body shown above. The renderStatus could be either SUCCESS or FAILED.
If the request FAILED, you should contact support to figure out why your PDF generation failed.
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.

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

html
string
required
The HTML content you want to render
webhook
string
required
The url of your webhook
pdfParams
object
The object containing the parameters for your PDF. See all the options here.
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)
hasCover
boolean
If true, will hide the footer and the header elements on the first page of the generated PDF. (default: false)

Checking PDF Status

Instead of waiting for the webhook, you can also check the status of your PDF generation by polling the Get PDF Status endpoint using the requestId returned from this request.