API Exposure Guide

Parameter & Asset Management

REST endpoints for reading and mutating parameters and CSV files programmatically.

Parameter & Raw Asset Management (REST API)

For full programmatic control over the raw data layer:

Module Parameters

Global variables used across models, compliance, and outputs can be read and mutated:

  • GET /api/module-params: Returns current parameters and allowed values.
  • POST/PUT /api/module-params: Accepts a JSON key-value object to update parameters, instantly triggering a graph rebuild.

Raw Asset Files

For applications requiring bulk uploads or raw CSV data manipulation (such as custom Table Editor web-apps), Rescile exposes a direct REST API under /api/assets.

  • GET /api/assets: Returns a JSON array of available .csv asset files.
  • GET /api/assets/{filename}: Returns the raw text content of the CSV.
  • POST/PUT /api/assets/{filename}: Mutates the asset using multipart/form-data.

The mutation endpoint accepts one of three form fields to dictate processing:

  1. data: Replaces the entire content of the CSV file (Full Overwrite).
  2. update: A CSV string containing headers and rows to insert or update (Partial Write/Upsert).
  3. remove: A CSV string containing the primary key header and the keys to delete (Partial Delete).
const fd = new FormData();
fd.append('update', 'name,customer\ninst1,ydc\ninst2,ydc');
fetch('/api/assets/instance.csv', { method: 'POST', body: fd });