Skip to main content
GET https://api.pdfnoodle.com/v1/integration/templates/:templateId/variables

Request

Response

This endpoint responds with 200 OK and returns all variables from the template. The response structure matches the variables used in the template, including nested objects and arrays.
The example above shows a variable schema from an invoice template. The actual response will vary depending on the template’s structure and variables.

Path Parameters

string
required
Template identifier (the name field from the template, same as id from list templates response, or the templateId returned from create template endpoint)

Response Fields

The response contains all variables from the template. The structure will vary depending on the template, but will include all variables, nested objects, and arrays that are used in the template.

Usage

This endpoint is essential for:
  • Understanding what data fields are required to render a template
  • Building dynamic forms for template data input
  • Validating data before rendering
  • Generating API documentation for template-specific data structures
  • Discovering available variables programmatically
The response structure matches the variables used in the template. Use this endpoint to discover what data fields are required when rendering a template with the generate-pdf-from-template endpoint.

Usage Example

Here’s a complete example of fetching template variables and using them to build a data payload:

Error Responses

401 Unauthorized

Occurs when: The API key is missing or invalid.

404 Not Found

Occurs when: The requested template doesn’t exist or isn’t fully created yet.

500 Internal Server Error

Occurs when: Variable extraction fails or an internal server error prevents the operation from completing.
The template must be fully created and available before you can fetch its variables. If you try to fetch variables for a template that’s still being created (status ONGOING), you’ll receive a 404 Not Found error.