Saving a version

Save a new version.

POST /projects/{id}/versions is the headless equivalent of the platform's "Save project": it commits an updated vendor file as a new version of an existing project. Requires code_write.

Contract

  • Body is the same shape as ingest — { originalFilename, file: { inline | blob_url } } — but it targets an existing project rather than resolving/creating an identity.
  • The file must be the same vendor as the project (an L5X stays L5X, a Siemens ZIP stays Siemens). A mismatch returns 400.
  • Re-sending the exact bytes of the current version is a no-op: 200 with resolution: identical_file and no new version.
  • A real commit returns 201, bumps the project's current version, and kicks off re-analysis — billed identically to a UI save.
python
res = client.commit_version("prj_…", file_path="Conveyor_edited.L5X")
print(res.resolution)    # add_version | identical_file
print(res.version_id)    # the new version, or None for identical_file
csharp
var res = await client.CommitVersionAsync(
    "prj_…", File.ReadAllBytes("Conveyor_edited.L5X"), "Conveyor.L5X");
Console.WriteLine(res.Resolution);  // add_version | identical_file
Console.WriteLine(res.VersionId ?? "null");

A project-scoped key may only commit to in-scope projects, and can never create a new project identity (that requires ingest with an unscoped key). The write requires an Idempotency-Key.