curl -X POST 'https://api.anyformat.ai/v3/workflows/0686bb97-8c30-70f0-8000-97669e000eb8/report-templates/' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-F 'file=@/path/to/safety-plan.docx'
template = client.upload_report_template("0686bb97-8c30-70f0-8000-97669e000eb8", "safety-plan.docx")
print(template.id, template.placeholders)
const template = await af.uploadReportTemplate(
"0686bb97-8c30-70f0-8000-97669e000eb8",
new File([bytes], "safety-plan.docx"),
);
{
"id": "069dcc2c-e14c-7606-8000-2ee4fb17b4e2",
"name": "safety-plan.docx",
"size_bytes": 48213,
"placeholders": ["crew", "sections", "site_name"]
}
Upload
Upload Report Template
Upload the Word document a Report generator node fills
POST
/
v3
/
workflows
/
{workflow_id}
/
report-templates
/
curl -X POST 'https://api.anyformat.ai/v3/workflows/0686bb97-8c30-70f0-8000-97669e000eb8/report-templates/' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-F 'file=@/path/to/safety-plan.docx'
template = client.upload_report_template("0686bb97-8c30-70f0-8000-97669e000eb8", "safety-plan.docx")
print(template.id, template.placeholders)
const template = await af.uploadReportTemplate(
"0686bb97-8c30-70f0-8000-97669e000eb8",
new File([bytes], "safety-plan.docx"),
);
{
"id": "069dcc2c-e14c-7606-8000-2ee4fb17b4e2",
"name": "safety-plan.docx",
"size_bytes": 48213,
"placeholders": ["crew", "sections", "site_name"]
}
Uploads one Word (
.docx) document, at most 20 MB, as a template of the workflow. Put the returned id in a Report generator node’s template_file_id. Word templates are in alpha and enabled per organization; without the feature the request answers 403.
Send the document as multipart form data under the file field.
The response lists the placeholders the document reads: the field keys inside {{ … }}, {%p if … %} and {%tr for … %}. A document whose placeholders are not valid syntax is refused with 400 and error_code: "UNSUPPORTED_FILE_TYPE".
A template is never changed. To replace one, upload the new document and point the node at its id.
curl -X POST 'https://api.anyformat.ai/v3/workflows/0686bb97-8c30-70f0-8000-97669e000eb8/report-templates/' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-F 'file=@/path/to/safety-plan.docx'
template = client.upload_report_template("0686bb97-8c30-70f0-8000-97669e000eb8", "safety-plan.docx")
print(template.id, template.placeholders)
const template = await af.uploadReportTemplate(
"0686bb97-8c30-70f0-8000-97669e000eb8",
new File([bytes], "safety-plan.docx"),
);
{
"id": "069dcc2c-e14c-7606-8000-2ee4fb17b4e2",
"name": "safety-plan.docx",
"size_bytes": 48213,
"placeholders": ["crew", "sections", "site_name"]
}
Authorizations
Response
Successful Response

