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
| Method | Path | Purpose |
|---|---|---|
GET | /api/session/{sessionId}/files | File list |
GET | /api/session/{sessionId}/file?path={path} | Contents of a single file |
GET | /api/session/{sessionId}/download | Download the entire project |
path must be URL-encoded.
History and rollback
| Method | Path | Purpose |
|---|---|---|
GET | /api/session/{sessionId}/history | Commit history |
GET | /api/session/{sessionId}/transcript | Full conversation transcript |
GET | /api/session/{sessionId}/diff?hash={hash} | Changes in a specific commit |
POST | /api/session/{sessionId}/revert | Roll 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
| Method | Path | Purpose |
|---|---|---|
POST | /api/session/{id}/commit | Commit the changes made so far (message in the body, optional) |
POST | /api/session/{id}/discard | Discard changes and reset the session to its initial state |
POST | /api/session/{id}/verify | Verify 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.