[POST] .../v1/docprintform/add
Creates a new form on printing documents. Use this method to create an RTF print form template that can later be attached to document types through PrintFormType and rendered with DocPrintForm/Prepare. JSON requests require name and may include base64 data; multipart/form-data requests require name and may send the RTF template as an uploaded file instead of data. The version field must be 1 for inline storage or 2 for common-file storage, template payloads are limited to 2 MB and the current request user must have print form add permission. Missing body, missing or long name, invalid version, invalid base64 data, oversized files, denied access, common-file storage errors, database failures, transaction failures and action-log failures are returned as HTTP 200 ErrorResult business errors.
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| data | String | Optional | Optional RTF template payload encoded as base64. The decoded payload must not exceed 2 MB. |
| name | String | Required | Print form name, up to 150 characters. |
| version | Int32 | Optional | Storage version: 1 stores the template inline, 2 stores it as a common file. Default value is 1. |
Request Example
{
"name": "Purchase invoice",
"data": "e1xydGYxXGFuc2lcZGVmZjB7XGZvbnR0Ymx9fQ==",
"version": 1
}
Response Parameters
| Name | Type | Description |
|---|---|---|
| ok | Boolean | Indicates whether the request completed successfully. |
| result | Insert | Created record result. |
Response Example
{
"ok": true,
"result": {
"new_id": 1001
}
}