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.Request
Response
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 thetemplateId returned from this request.
The template will have different status values:
ONGOING: Template creation is still in progressSUCCESS: Template has been created successfullyFAILED: Template creation failed (checkmetadata.errorMessage)
Usage Example
Here’s a complete example of creating a template and polling for completion:- Node.js
- Python