API compatibility

API compatibility

What the /v1 contract keeps stable, and what a restart does to a running analysis.

Kaimei API 1.0.0 serves the /v1 surface. GET /health reports the service version and api: "v1". The Python client 0.9.2 speaks this surface. A 0.9.1 client keeps working, because this release only adds to /v1.

  • Additions are allowed. New fields, new optional parameters, new error codes and new endpoints can appear in /v1.
  • Existing fields stay. A field that is already there keeps its name and its meaning. A rename, a removal, or a value whose meaning changed ships under a new path, not inside /v1.
  • Errors keep one envelope. {"error": {"type", "code", "message", "param"}}. code and param are left out when they do not apply.
  • Lists page the same way. limit and offset, and a page of object, data, total, limit, offset, has_more.

Starting the API applies any numbered database migration the database has not recorded. An analysis is a row: a restart resumes a job whose worker is gone, and after three interrupted attempts the job fails and can be started again. Rate limits are rows too, so every process of one deployment shares one window. Every response carries X-Request-Id. Send one made of letters, digits and ._:-, up to 64 characters, to keep your own; otherwise Kaimei assigns one.

A structure document includes verification: verified, unchecked (stored with no library check; it still runs), reupload (a client before 0.7.2 may have saved one tree of a forest as the whole model), drawn, builtin or schematic.