Skip to main content
Use this endpoint to check the status of a PDF generation request. This is particularly useful when:
  • You’ve made an asynchronous request and want to poll for status instead of waiting for the webhook
  • A synchronous request timed out (>30 seconds) and was automatically queued asynchronously
GET https://api.pdfnoodle.com/v1/pdf/status/:requestId

Request

curl --location 'https://api.pdfnoodle.com/v1/pdf/status/pdfnoodle_request_123456789' \
--header 'Authorization: Bearer pdfnoodle_api_123456789'

Response

The endpoint responds with 200 OK and returns the current status of the PDF generation:
{
  "requestId": "pdfnoodle_request_123456789",
  "renderStatus": "ONGOING",
  "signedUrl": "",
  "metadata": {}
}

Parameters

requestId
string
required
The requestId returned from an asynchronous request or from a synchronous request that timed out

Response Fields

If the renderStatus is FAILED, you should contact support to figure out why your PDF generation failed.

Usage Example

Here’s a complete example of polling for PDF status:
async function checkPdfStatus(requestId) {
  const maxAttempts = 60; // Poll for up to 5 minutes (60 * 5 seconds)
  let attempts = 0;

  while (attempts < maxAttempts) {
    const response = await fetch(
      `https://api.pdfnoodle.com/v1/pdf/status/${requestId}`,
      {
        method: "GET",
        headers: {
          Authorization: "Bearer pdfnoodle_api_123456789",
        },
      }
    );

    const result = await response.json();

    if (result.renderStatus === "SUCCESS") {
      return result.signedUrl;
    }

    if (result.renderStatus === "FAILED") {
      throw new Error("PDF generation failed");
    }

    // Wait 5 seconds before checking again
    await new Promise((resolve) => setTimeout(resolve, 5000));
    attempts++;
  }

  throw new Error("PDF generation timed out");
}