Skip to main content

Create or replace a version of a model at a version number

PUT 

/models/:modelId/versions/:version

Available in development only — the sandbox and production tables are replicas of development, so models cannot be written there.

Stores the payload at the version number in the path, creating that version if it does not exist and replacing it if it does. Replacing is how a model published to development is corrected without burning a version number on it. Fields the payload leaves out are removed from the stored version.

A version number that has not been used before must still supersede every version already created, exactly as it must on POST — a version cannot be inserted below the latest one.

The path names the version. A version in the payload is optional, and is rejected if it disagrees with the path, so a whole representation as returned by a GET can be sent back unedited.

Once a version is published to sandbox or production it carries frozenAt and can no longer be replaced — the version number has to stay a faithful record of what those environments ran, and a rollback does not release it. Changing a frozen version means creating a new one.

Storing a version does not change what any environment is pointing at.

Request

Responses

Version replaced successfully