GET https://api.pdfnoodle.com/v1/integration/templates
Request
curl --location 'https://api.pdfnoodle.com/v1/integration/templates' \
--header 'Authorization: Bearer pdfnoodle_api_123456789'
Response
Success (200 OK)
Empty Result (200 OK)
{
"templates" : [
{
"id" : "invoice-template-001" ,
"displayName" : "Standard Invoice"
},
{
"id" : "receipt-template-002" ,
"displayName" : "Receipt Template"
}
]
}
This endpoint responds with 200 OK and returns a list of all templates available for your company. Templates are returned sorted alphabetically by displayName in ascending order.
Response Fields
Usage
This endpoint is useful for:
Displaying available templates in a UI
Building template selection interfaces
Discovering which templates are available before fetching details
Getting template IDs to use with other endpoints
The id field in the response corresponds to the template’s name field in
the database. Use this value as the templateId or name parameter when
fetching a specific template or its variables.
Usage Example
Here’s a complete example of listing templates and then fetching details for a specific template:
// List all templates
const listResponse = await fetch (
"https://api.pdfnoodle.com/v1/integration/templates" ,
{
headers: { Authorization: "Bearer pdfnoodle_api_123456789" },
}
);
const { templates } = await listResponse . json ();
console . log ( "Available templates:" , templates );
// Get the first template's ID
if ( templates . length > 0 ) {
const templateId = templates [ 0 ]. id ;
console . log ( "First template ID:" , templateId );
// Fetch template details
const templateResponse = await fetch (
`https://api.pdfnoodle.com/v1/integration/templates/ ${ templateId } ` ,
{
headers: { Authorization: "Bearer pdfnoodle_api_123456789" },
}
);
const templateData = await templateResponse . json ();
console . log ( "Template details:" , templateData );
}
import requests
# List all templates
response = requests.get(
'https://api.pdfnoodle.com/v1/integration/templates' ,
headers = { 'Authorization' : 'Bearer pdfnoodle_api_123456789' }
)
result = response.json()
templates = result[ 'templates' ]
print ( 'Available templates:' , templates)
# Get the first template's ID
if templates:
template_id = templates[ 0 ][ 'id' ]
print ( 'First template ID:' , template_id)
# Fetch template details
template_response = requests.get(
f 'https://api.pdfnoodle.com/v1/integration/templates/ { template_id } ' ,
headers = { 'Authorization' : 'Bearer pdfnoodle_api_123456789' }
)
template_data = template_response.json()
print ( 'Template details:' , template_data)
Error Responses
401 Unauthorized
{
"message" : "Unauthorized"
}
Occurs when: The API key is missing or invalid.
500 Internal Server Error
{
"message" : "Couldnt get templates"
}
Occurs when: An internal server error prevents the operation from completing.