Skip to main content

Sessions

A session is a single unit of work for building an app. The agent edits files, those changes accumulate as commits, and you can roll them back if needed.

Creating a session

POST /api/session

The id in the response is the {sessionId} for all subsequent session calls.

Keep-alive

POST /api/session/{sessionId}/ping

Send this periodically so the session isn't cleaned up as idle. The web UI keeps calling it while the work screen stays open.

Files

MethodPathPurpose
GET/api/session/{sessionId}/filesFile list
GET/api/session/{sessionId}/file?path={path}Contents of a single file
GET/api/session/{sessionId}/downloadDownload the entire project

path must be URL-encoded.

History and rollback

MethodPathPurpose
GET/api/session/{sessionId}/historyCommit history
GET/api/session/{sessionId}/transcriptFull conversation transcript
GET/api/session/{sessionId}/diff?hash={hash}Changes in a specific commit
POST/api/session/{sessionId}/revertRoll back to a specific commit (hash in the body)

A rollback does not erase history — the rollback itself is recorded as a new commit.

Committing and discarding

MethodPathPurpose
POST/api/session/{id}/commitCommit the changes made so far (message in the body, optional)
POST/api/session/{id}/discardDiscard changes and reset the session to its initial state
POST/api/session/{id}/verifyVerify that the app actually runs
DELETE/api/session/{sessionId}Delete the session

Sharing

PUT /api/session/{id}/share

Send an array of user IDs to grant view access in the body.

{ "users": ["kim.cs", "park.jh"] }

Sending an empty array removes sharing.

Data context

PUT /api/session/{id}/data-context

Specifies which equipment and tags the session targets. The agent references this scope when building the app. Sending null clears it.