Report templates
They define how a report looks: which statistics it carries, in which layout and with which colour scale. A configuration references them by id.
GET
/api/v2/templatesThe account's templates.
Parámetros
analysisTypestringoptionalcounting · replanting · pathFilters by analysis type.
reportTypestringoptionalFilters by exact reportType.
reportCategorystringoptionalgeneral · vegetation_indexFilters by category.
pageintegeroptionaldefault 1Page number, starting at 1.
limitintegeroptionaldefault 20 · max 100Results per page.
GET
/api/v2/templates/presetsStarter templates, each with a ready-to-POST seedPayload.
A tener en cuenta
- The path that works first time: take a preset, override `name`, POST the result. Authoring `layouts` by hand means writing nested 0..1 normalised coordinates.
POST
/api/v2/templatesCreates a template. Returns 201 with the serialized document.
A tener en cuenta
- Counts against the plan's template limit, shared between the owner and every sub-user.
- A 400 carries the per-field detail in `issues` — read it, it says exactly what was refused.
GET
/api/v2/templates/{id}One template by id.
PUT
/api/v2/templates/{id}Replaces the whole template.
A tener en cuenta
- It is a REPLACE, not a merge: send the whole document. A partial merge over `layouts` leaves a half-updated layout that renders wrong.
- `userId` in the body is ignored. Ownership is not reassignable.
DELETE
/api/v2/templates/{id}Deletes the template.
POST
/api/v2/templates/validate-formulaValidates a Custom_Index formula against the same parser the server enforces, and reports whether it uses L.
Parámetros
formulastringrequiredThe expression to validate. 2000 characters max.
Response
json
{
"valid": true,
"usesL": true
}A tener en cuenta
- Validate BEFORE creating. Otherwise the only signal is a rejected template, which reads as "the template is wrong" rather than "the formula is".
- `usesL: true` means the template also needs `saviL`.
