Skip to main content
Template creation is processed asynchronously. The endpoint returns immediately with a templateId that you can use to check the creation status. Template creation usually takes a couple of minutes, but can vary based on complexity and system load.
POST https://api.pdfnoodle.com/v1/integration/templates/create

Request

Response

This endpoint responds with 202 Accepted immediately after starting the template creation process. The response includes a templateId that you can use to check the creation status.

Parameters

string
required
Text description of the template you want to create. This will be enriched by AI to generate the final template. Provide detailed, specific prompts for better results. Include information about: - Document type (invoice, receipt, report, etc.) - Required sections (header, footer, body content) - Layout preferences - Data fields that need to be included
string
required
Human-readable name for the template (e.g., “Invoice Template”, “Receipt Template”)
string
Optional URL to a reference file (PDF, image, etc.) that the AI can use as inspiration for the template design. This can help the AI understand your design preferences if you have an existing document to reference.

Response Fields

Checking Template Creation Status

After creating a template, you can check its status by polling the Get Template endpoint using the templateId returned from this request. The template will have different status values:
  • ONGOING: Template creation is still in progress
  • SUCCESS: Template has been created successfully
  • FAILED: Template creation failed (check metadata.errorMessage)

Usage Example

Here’s a complete example of creating a template and polling for completion:
If template creation fails, the status will be set to FAILED and error details will be available in the metadata when fetching the template. You should handle these errors appropriately in your application.

Error Responses

401 Unauthorized

Occurs when: The API key is missing or invalid.

500 Internal Server Error

Occurs when: An internal server error prevents the template creation from starting.