Edit
[POST] .../v1/reportbuildertemplate/edit
Edits a current user's report builder template. Replace an existing report builder template owned by the current user. The request identifies the template by id and stores the full new domain, name, description, structure, filters and options payload. Filters use the shared Field/Operator/Value array and are normalized against GetSchema. Provided fields, operators and values must be valid; required report filters may be filled later. Templates owned by another user are treated as missing. This method requires billing db version 406 or later and an account tariff with report builder enabled; older account databases return ErrorResult 1008 and disabled tariff returns ErrorResult 7501. The caller must have report-builder permission 759; missing body, denied access, unavailable tariff, missing template, invalid fields, oversized template payload, unavailable domain schema and storage errors are returned as HTTP 200 ErrorResult.
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| description | String | Optional | Optional template description. |
| domain | String | Required | Report builder domain code. |
| filters | Array of Filter | Optional | Saved report filters using Field, Operator and string Value. In values are comma-separated; dates use Unix seconds. |
| id | Int64 | Required | Template ID. |
| name | String | Required | User-visible template name. |
| options | Object | Optional | Saved report rendering and calculation options keyed by codes returned in schema.options. |
| structure | ReportBuilderStructure | Required | Saved report table structure. |
Filterable Fields
Load the available filter fields and operators from POST /reportbuilder/getschema using the same domain value. Read the returned result.filters metadata.
Request Example
{
"id": 10,
"domain": "Nomenclature",
"name": "Stock by warehouse",
"description": "Current stock balance grouped by item and warehouse.",
"structure": {
"row_groups": [
"item_group.name",
"item.name"
],
"row_columns": [
"item.code",
"unit.name"
],
"column_groups": [
"stock.name"
],
"metrics": [
"stock_balance.current_quantity"
]
},
"filters": [
{
"Field": "firm_id",
"Operator": "Equal",
"Value": "1"
},
{
"Field": "stock_id",
"Operator": "In",
"Value": "1,2"
}
],
"options": {
"include_totals": true
}
}
Response Parameters
| Name | Type | Description |
|---|---|---|
| ok | Boolean | Indicates whether the request completed successfully. |
| result | Update | Update operation result. |
Response Example
{
"ok": true,
"result": {
"row_affected": 1
}
}