Browse documentation
Docs/Integrate

Model lifecycle API

Deploy, inspect, update, resolve, rename, and delete models through the public API.

Model lifecycle API

Lifecycle at a glance

Operation Method and path
List summaries GET /api/model-summaries
Deploy POST /api/models
Get model GET /api/models/:id
Get manifest GET /api/models/:id/manifest
Get source GET /api/models/:id/source
Replace source PUT /api/models/:id/source
Write input PUT /api/models/:id/input
Write inputs PUT /api/models/:id/inputs
Resolve symbols POST /api/models/:id/symbols/resolve
Read range GET /api/models/:id/ranges/:range
Rename POST /api/models/:id/rename
Delete DELETE /api/models/:id

Deploy

{
  "id": "revenue-api",
  "source": "input Revenue = 100000\noutput NetRevenue = Revenue * 0.79",
  "protectedMode": true
}

Exactly one of source or canonicalModel is required. id is optional.

Read and replace source

GET /api/models/revenue-api/source
{
  "source": "input Revenue = 100000\noutput NetRevenue = Revenue * 0.79",
  "sourceHash": "a-lowercase-sha256-value"
}

Replace source with compare-and-swap protection:

{
  "source": "input Revenue = 120000\noutput NetRevenue = Revenue * 0.79",
  "baseSourceHash": "the-hash-returned-by-get-source"
}

Write inputs

Single input:

{
  "symbol": "Revenue",
  "value": 120000,
  "expectedRequestRev": 4
}

expectedRequestRev is optional. Batch input:

{
  "writes": [
    { "symbol": "Revenue", "value": 120000 },
    { "symbol": "TaxRate", "value": 0.21 }
  ]
}

In protected mode, only declared inputs are writable. Validation rules still apply at every write surface.

Resolve symbols

{
  "symbols": ["Revenue", "NetRevenue"]
}

The response is keyed by requested symbol. An ordinary ready value follows the symbol snapshot shape:

{
  "NetRevenue": {
    "symbol": "NetRevenue",
    "status": "ready",
    "value": {
      "kind": "number",
      "value": 94800,
      "typeTag": "number"
    },
    "requestRev": 1,
    "resolvedRev": 1
  }
}

Revision values above are illustrative and server-owned. Clients use them for ordering and concurrency; they do not assign them.

Rename and delete

Rename body:

{ "name": "FY27 Revenue" }

Delete returns a JSON boolean:

true

Conflict-safe clients

Keep the latest source hash and symbol request revision with the state that produced the user's edit. On conflict, refetch and reconcile. Do not retry by dropping the guard, because that silently turns an intended compare-and-swap into last-writer-wins.