Browse the documentation

REST API

REST API

The Layerz REST API under /api/v1, for integrations that create, edit, compute and feed financial models over HTTP. Conventions and every route.

The REST API serves integrations that drive Layerz from code: a script that builds a model, a pipeline that pushes the monthly close, a back office that reads computed figures. AI agents usually prefer the MCP server, which covers more (imports from files, export, branches, history) and carries the modelling context.

Conventions

  • Base URL: https://layerz.cc/api/v1.
  • Authentication: Authorization: Bearer <token> on every call. See Authentication.
  • Format: JSON in, JSON out, UTF-8. Dates are YYYY-MM-DD, periods YYYY, YYYY-Qn or YYYY-MM.
  • References: items are addressed by their uid; most write endpoints also accept an item's name where a uid is expected.
  • Values are expressed in the model's conventions (currency, units, signs), stated in its FINANCE.md.
  • Versions: every write that changes a model records a version.
  • Errors and limits: see Limits and errors.

Routes

Generated from the server's route files.

Path (under /api/v1)Methods
/mapping-setsGET POST
/mapping-sets/:idGET DELETE
/mapping-sets/:id/mappingsPOST
/modelsGET POST
/models/:idGET PATCH DELETE
/models/:id/blueprintPOST
/models/:id/computeGET
/models/:id/duplicatePOST
/models/:id/external-refsGET POST
/models/:id/external-refs/:uidDELETE
/models/:id/external-refs/refreshPOST
/models/:id/finance-mdGET PUT
/models/:id/itemsGET POST
/models/:id/items/:uidGET PATCH DELETE
/models/:id/items/:uid/dependentsGET
/models/:id/items/batchPOST
/models/:id/items/batch-deletePOST
/models/:id/items/batch-updatePATCH
/models/:id/items/reorderPOST
/models/:id/listsGET POST
/models/:id/lists/:listIdGET PATCH DELETE
/models/:id/snapshotGET PUT
/models/:id/sourcesGET POST
/models/:id/sources/:sourceId/rowsPOST
/models/:id/sources/:sourceId/rulesGET PUT DELETE
/models/:id/versionsGET POST
/models/:id/versions/:versionIdGET PATCH POST
/models/:id/versions/:versionId/diffGET
/templatesGET
/templates/:idGET

Pages