Skip to content

Changes

Changes operations in the Hlix API.

See the OpenAPI document for schemas and operation IDs.

  • Protected operations require an API key in x-api-key or a browser session cookie; some actions require a verified user session
  • Tenant-scoped operations use X-Organization-Id; browser sessions can use their active workspace. Discovery and personal-workspace bootstrap do not require an active workspace
  • The base URL for your deployment, https://server.hlix.ai by default
Method Path Operation
GET /v1/api/projects/{id}/branches List the branches of the project the Files surface can read
POST /v1/api/projects/{id}/branches Cut a branch to edit files by hand
POST /v1/api/projects/{id}/branches/merge Merge an edit branch back into the branch it was cut from
GET /v1/api/projects/{id}/changes Get the project’s changed files and checkpoint commits
GET /v1/api/projects/{id}/changes/file Get one changed file’s unified diff
GET /v1/api/projects/{id}/files List every path in the project’s head tree
POST /v1/api/projects/{id}/files/commit Commit hand edits to an edit branch
GET /v1/api/projects/{id}/files/content Get one file of the project’s head tree
PUT /v1/api/projects/{id}/files/working Save one file into a running cycle’s Cloud Machine

List the branches of the project the Files surface can read

Section titled “List the branches of the project the Files surface can read”

GET /v1/api/projects/{id}/branches · operation ID listProjectBranches

Parameters

Name In Required Type Description
id path yes string
repo query no string Which repository of a multi-repo project. Omitted, the primary one.
X-Organization-Id header no string The workspace (organization) to act in. Omitted, the session’s active organization is used.

Responses

Status Body Description
200 ProjectBranches The repository’s default branch, the project’s preview branch, then the integration branch of every cycle that dispatched work and each task’s branch, newest first. Read from the project’s own records, never from the repository host, so a listed branch may already be gone. Branches another project keeps in the same repository are never listed.
400 ApiError The request named no active organization.
401 ApiError No valid session or API key.
403 ApiError Browsing the repository is restricted to the agency. Every client-role collaborator is refused here, even one that may read the project’s changes.
404 ApiError No such project in this workspace, or the caller is a client collaborator with no grant on it. The project may also have no repository.

POST /v1/api/projects/{id}/branches · operation ID startProjectEditBranch

Parameters

Name In Required Type Description
id path yes string
X-Organization-Id header no string The workspace (organization) to act in. Omitted, the session’s active organization is used.

Request body — application/json, StartEditBranch (required)

Property Type Required Notes
from string yes min length 1
fromSha string yes
repo string no

Responses

Status Body Description
201 EditBranch The new edit branch, cut at fromSha, and the branch it will merge back into.
400 ValidationError | ApiError The JSON body failed schema validation (ValidationError), or the request named no active organization (ApiError).
401 ApiError No valid session or API key.
403 ApiError Browsing the repository is restricted to the agency. Every client-role collaborator is refused here, even one that may read the project’s changes.
404 ApiError No such project in this workspace, or the caller is a client collaborator with no grant on it. Or from is not a branch the project owns.
502 ApiError The repository host refused the new branch.

Merge an edit branch back into the branch it was cut from

Section titled “Merge an edit branch back into the branch it was cut from”

POST /v1/api/projects/{id}/branches/merge · operation ID mergeProjectEditBranch

Parameters

Name In Required Type Description
id path yes string
X-Organization-Id header no string The workspace (organization) to act in. Omitted, the session’s active organization is used.

Request body — application/json, MergeEditBranch (required)

Property Type Required Notes
ref string yes min length 1
repo string no

Responses

Status Body Description
200 MergeEditBranchResult The merge commit on the base branch. The edit branch is deleted and the project manager is told.
400 ValidationError | ApiError The JSON body failed schema validation (ValidationError), or the request named no active organization (ApiError).
401 ApiError No valid session or API key.
403 ApiError Browsing the repository is restricted to the agency. Every client-role collaborator is refused here, even one that may read the project’s changes.
404 ApiError No such project in this workspace, or the caller is a client collaborator with no grant on it. Or ref is not an open edit branch.
409 ApiError The edits conflict with the base, or the base branch is gone. Nothing was merged.
502 ApiError The repository host refused the merge.

Get the project’s changed files and checkpoint commits

Section titled “Get the project’s changed files and checkpoint commits”

GET /v1/api/projects/{id}/changes · operation ID getProjectChanges

Parameters

Name In Required Type Description
id path yes string
repo query no string Which repository of a multi-repo project. Omitted, every repository (the primary one for a single-file read).
since query no string A 40-character commit sha to compare against instead of the default branch.
ref query no string Read this branch instead of the project’s preview branch. Only a branch GET /v1/api/projects/:id/branches lists is accepted; any other name, another project’s branch in a shared repository included, is a 404. Naming a branch is agency-only.
page query no string Which page of an HLIX Repos repository’s change list, from 0 (the default). Each page lists up to 500 files in path order; the response’s nextPage names the next one. Ignored for GitHub repositories, whose list is not paged.
X-Organization-Id header no string The workspace (organization) to act in. Omitted, the session’s active organization is used.

Responses

Status Body Description
200 ProjectChanges Project changes, plus inFlight entries for running tasks whose Cloud Machines are reachable. Unreachable machines are omitted. Untracked files have additions: null. source: "github" and source: "hlix-repos" read committed source from the repository host without starting a Cloud Machine.
400 ApiError since is not a 40-character commit sha, or names no commit in this project’s repository. Or page is not a whole number.
401 ApiError No valid session or API key.
403 ApiError With ref: Browsing the repository is restricted to the agency. Every client-role collaborator is refused here, even one that may read the project’s changes.
404 ApiError No such project in this workspace, or the caller is a client collaborator with no grant on it. The project may also have no connected repository. With ref: the project does not own that branch, or the repository no longer has it.
502 ApiError The repository host answered neither the comparison nor the file. Nothing about the project changed; retrying is safe.
504 ApiError The read did not finish within the request deadline (10 s). The project is unchanged; retrying is safe.

GET /v1/api/projects/{id}/changes/file · operation ID getProjectChangeFile

Parameters

Name In Required Type Description
id path yes string
path query yes string The repository-relative file path.
repo query no string Which repository of a multi-repo project. Omitted, every repository (the primary one for a single-file read).
since query no string A 40-character commit sha to compare against instead of the default branch.
cycleId query no string Read from this cycle’s running build agent Cloud Machine instead of the repository.
ref query no string Read this branch instead of the project’s preview branch. Only a branch GET /v1/api/projects/:id/branches lists is accepted; any other name, another project’s branch in a shared repository included, is a 404. Naming a branch is agency-only.
X-Organization-Id header no string The workspace (organization) to act in. Omitted, the session’s active organization is used.

Responses

Status Body Description
200 ChangeFilePatch A file’s unified diff. patch is null for binary files or when the response exceeds its byte limit; use binary to distinguish these cases. repo selects a repository, and since must match the comparison base used for the file list. cycleId reads from the cycle’s running build agent Cloud Machine against the commit at which that run started.
400 ApiError path is missing or is not a repository-relative file path — it is absolute, or contains a .. segment, a backslash, a NUL or an empty segment. since is not a 40-character commit sha, or names no commit in this project’s repository.
401 ApiError No valid session or API key.
403 ApiError Authenticated, but not a member of the named organization — or a client collaborator without the required access on this project.
404 ApiError No such project, or that path is not in the project’s change set. With cycleId: the cycle has no running build agent in this project, or its machine could not be reached. With ref: the project does not own that branch, or the repository no longer has it.
502 ApiError The repository host answered neither the comparison nor the file. Nothing about the project changed; retrying is safe.
504 ApiError The read did not finish within the request deadline (10 s). The project is unchanged; retrying is safe.

List every path in the project’s head tree

Section titled “List every path in the project’s head tree”

GET /v1/api/projects/{id}/files · operation ID listProjectFiles

Parameters

Name In Required Type Description
id path yes string
repo query no string Which repository of a multi-repo project. Omitted, every repository (the primary one for a single-file read).
ref query no string Read this branch instead of the project’s preview branch. Only a branch GET /v1/api/projects/:id/branches lists is accepted; any other name, another project’s branch in a shared repository included, is a 404. Naming a branch is agency-only.
X-Organization-Id header no string The workspace (organization) to act in. Omitted, the session’s active organization is used.

Responses

Status Body Description
200 TreeListing Regular file paths in the repository head tree, sorted. Symlinks, submodules and ignored paths, including the project’s .env, are excluded. truncated: true means the list exceeds the server or repository host entry limit. Results are cached per tree and carry an ETag; a matching If-None-Match returns 304.
400 ApiError The request named no active organization.
401 ApiError No valid session or API key.
403 ApiError Browsing the repository is restricted to the agency. Every client-role collaborator is refused here, even one that may read the project’s changes.
404 ApiError No such project, or no such repository in it. With ref: the project does not own that branch, or the repository no longer has it.
502 ApiError The repository host answered neither the comparison nor the file. Nothing about the project changed; retrying is safe.
504 ApiError The read did not finish within the request deadline (10 s). The project is unchanged; retrying is safe.

POST /v1/api/projects/{id}/files/commit · operation ID commitProjectFileEdits

Parameters

Name In Required Type Description
id path yes string
X-Organization-Id header no string The workspace (organization) to act in. Omitted, the session’s active organization is used.

Request body — application/json, CommitEdits (required)

Property Type Required Notes
files object[] yes
headSha string yes
message string yes min length 1, max length 2000
ref string yes min length 1
repo string no

Responses

Status Body Description
200 CommitEditsResult The new commit. The project manager is told.
400 ValidationError | ApiError The body failed schema validation (ValidationError), or it holds too many files, a file too large, or a path that cannot be changed here (ApiError).
401 ApiError No valid session or API key.
403 ApiError Browsing the repository is restricted to the agency. Every client-role collaborator is refused here, even one that may read the project’s changes.
404 ApiError No such project in this workspace, or the caller is a client collaborator with no grant on it. Or ref is not an open edit branch.
409 ApiError The branch moved since headSha. Nothing was written.
502 ApiError The repository host refused the commit.

GET /v1/api/projects/{id}/files/content · operation ID getProjectFileContent

Parameters

Name In Required Type Description
id path yes string
path query yes string The repository-relative file path.
repo query no string Which repository of a multi-repo project. Omitted, every repository (the primary one for a single-file read).
cycleId query no string Read from this cycle’s running build agent Cloud Machine instead of the repository.
ref query no string Read this branch instead of the project’s preview branch. Only a branch GET /v1/api/projects/:id/branches lists is accepted; any other name, another project’s branch in a shared repository included, is a 404. Naming a branch is agency-only.
at query no string Read the file at this 40-character commit (the one the tree was listed at) instead of the branch head, so a push between listing and reading cannot change the answer.
X-Organization-Id header no string The workspace (organization) to act in. Omitted, the session’s active organization is used.

Responses

Status Body Description
200 FileContent The file as UTF-8 text. binary: true means a NUL byte was found and no text is served. truncated: true means the file is longer than the viewer budget, or too large to read at all — in which case content is null and binary is not a verdict. An empty file is served as "", never as truncated. sha is git’s blob hash of the bytes read. The response carries an ETag; a repeat request with If-None-Match is answered 304.
400 ApiError path is missing or is not a repository-relative file path — it is absolute, or contains a .. segment, a backslash, a NUL or an empty segment.
401 ApiError No valid session or API key.
403 ApiError Browsing the repository is restricted to the agency. Every client-role collaborator is refused here, even one that may read the project’s changes.
404 ApiError The project or file does not exist. Ignored paths, symlinks and submodules are treated as absent; symlink targets are never read. With ref: the project does not own that branch, or the repository no longer has it.
502 ApiError The repository host answered neither the comparison nor the file. Nothing about the project changed; retrying is safe.
504 ApiError The read did not finish within the request deadline (10 s). The project is unchanged; retrying is safe.

Save one file into a running cycle’s Cloud Machine

Section titled “Save one file into a running cycle’s Cloud Machine”

PUT /v1/api/projects/{id}/files/working · operation ID saveProjectWorkingFile

Parameters

Name In Required Type Description
id path yes string
X-Organization-Id header no string The workspace (organization) to act in. Omitted, the session’s active organization is used.

Request body — application/json, WriteWorkingFile (required)

Property Type Required Notes
base string | null yes
content string yes
cycleId string yes min length 1
path string yes min length 1
repo string no

Responses

Status Body Description
200 SaveWorkingFileResult The file is saved in the running build agent’s working tree; sha is its new blob hash. The project manager is told; the build agent reads the file as it is now.
400 ValidationError | ApiError The body failed schema validation (ValidationError), or the file is too large, protected, inside .git, ignored, a symlink or outside the working tree (ApiError).
401 ApiError No valid session or API key.
403 ApiError Browsing the repository is restricted to the agency. Every client-role collaborator is refused here, even one that may read the project’s changes.
404 ApiError No such project in this workspace, or the caller is a client collaborator with no grant on it. Or the cycle has no running build agent, or its machine could not be reached.
409 ApiError The file changed since base, or the build agent’s run is finished or stopping, so a save would not be kept. Nothing was written.
504 ApiError The read did not finish within the request deadline (10 s). The project is unchanged; retrying is safe.

The response table for each operation lists its documented errors. Common status codes include:

  • 400 — the body failed schema validation, or the request named no active organization. A ValidationError body carries the failing fields; an ApiError body carries only error.
  • 401 — no valid session or API key.
  • 403 — authenticated, but not a member of the named organization, or a client collaborator without the required access.
  • 404 — check the resource ID and your access to the selected Workspace.
  • 409 — the expected revision or state is stale, or another operation currently owns the transition.
  • 500 — the operation failed server-side. Retry only where an idempotency key makes that safe.