Skip to content
helmstudio
Contents

sessions

GET /sessions

The calling studio's sessions, most recently opened first.

Ordered by `opened_at` descending with never-opened sessions last, then `created_at` descending. Deleted sessions are not listed.

Needs the kv capability.

GoList(ctx context.Context, params *SessionsListParams) (*SessionPage, error)
Pythondef list(self, *, limit: Optional[Any] = None, cursor: Optional[Any] = None) -> Any
JavaScriptlist(params = {})
ParameterInTypeAbout
limitqueryinteger
cursorquerystringThe `next_cursor` of the previous page, unchanged.
StatusBodyMeans
200SessionPageA page of sessions.
400ErrorThe request is malformed. Codes: `bad_request`, `bad_filter`, `bad_cursor`, `invalid_document`.
401ErrorNo studio token, or a revoked or unknown one. Code `unauthenticated`.
403ErrorThe token lacks a capability (`capability_required`, with `details.capability`), the job is not a task the studio may change (`not_a_task`), or the request came from another origin (`bad_origin`).

POST /sessions

Create a session.

A name is unique among the studio's live sessions (409 `name_taken`). The state's bytes count toward `kv_bytes` (Q20).

Needs the kv capability.

GoCreate(ctx context.Context, body SessionCreate) (*Session, error)
Pythondef create(self, body: Dict[str, Any]) -> Any
JavaScriptcreate(body)

Request body: SessionCreate (application/json)

StatusBodyMeans
201SessionThe new session.
400ErrorThe request is malformed. Codes: `bad_request`, `bad_filter`, `bad_cursor`, `invalid_document`.
401ErrorNo studio token, or a revoked or unknown one. Code `unauthenticated`.
403ErrorThe token lacks a capability (`capability_required`, with `details.capability`), the job is not a task the studio may change (`not_a_task`), or the request came from another origin (`bad_origin`).
409ErrorCodes: `etag_mismatch`, `name_taken`, `job_finished`, `already_running`, `not_running`, `port_conflict`, `heavy_conflict` (with `details.heavy`), `not_installed`, `conflict`, `in_use`, `missing`, `confirm_required` and `preview_changed` (with `details.preview`), `not_reclaimable`, and from M7: `approval_required` (with `details.approval`), `id_taken`, `not_fetched`, `already_exists`.
413ErrorThe body is over its limit. Code `too_large`, with `details.limit` in bytes.
429ErrorA per-studio quota is full. Code `quota_exceeded`, with `details` as QuotaDetails.

GET /sessions/{id}

One session. A deleted session, or another studio's, is 404.

Needs the kv capability.

GoGet(ctx context.Context, id string) (*Session, error)
Pythondef get(self, id: str) -> Any
JavaScriptget(id)
ParameterInTypeAbout
idpath · requiredULID
StatusBodyMeans
200SessionThe session.
401ErrorNo studio token, or a revoked or unknown one. Code `unauthenticated`.
403ErrorThe token lacks a capability (`capability_required`, with `details.capability`), the job is not a task the studio may change (`not_a_task`), or the request came from another origin (`bad_origin`).
404ErrorAbsent, deleted, or not the caller's to see. Code `not_found`.

PATCH /sessions/{id}

Rename, or merge changes into the state document.

R31a, M4 first review #11. A JSON merge patch over `{name, state}`: members of `state` merge into the stored state, and a `null` member removes that key. `name` cannot be null. With `If-Match`, only when the etag matches: two open tabs must not silently overwrite each other.

Needs the kv capability.

GoUpdate(ctx context.Context, id string, body map[string]any, params *SessionsUpdateParams) (*Session, error)
Pythondef update(self, id: str, body: Dict[str, Any], *, if_match: Optional[Any] = None) -> Any
JavaScriptupdate(id, body, params = {})
ParameterInTypeAbout
idpath · requiredULID
If-MatchheaderstringThe etag last read. When given and stale, the write is refused with 409 `etag_mismatch`.

Request body: SessionUpdate (application/merge-patch+json)

StatusBodyMeans
200SessionThe updated session.
400ErrorThe request is malformed. Codes: `bad_request`, `bad_filter`, `bad_cursor`, `invalid_document`.
401ErrorNo studio token, or a revoked or unknown one. Code `unauthenticated`.
403ErrorThe token lacks a capability (`capability_required`, with `details.capability`), the job is not a task the studio may change (`not_a_task`), or the request came from another origin (`bad_origin`).
404ErrorAbsent, deleted, or not the caller's to see. Code `not_found`.
409ErrorCodes: `etag_mismatch`, `name_taken`, `job_finished`, `already_running`, `not_running`, `port_conflict`, `heavy_conflict` (with `details.heavy`), `not_installed`, `conflict`, `in_use`, `missing`, `confirm_required` and `preview_changed` (with `details.preview`), `not_reclaimable`, and from M7: `approval_required` (with `details.approval`), `id_taken`, `not_fetched`, `already_exists`.
413ErrorThe body is over its limit. Code `too_large`, with `details.limit` in bytes.
429ErrorA per-studio quota is full. Code `quota_exceeded`, with `details` as QuotaDetails.

DELETE /sessions/{id}

Soft-delete. Its name becomes free; items keep their session_id.

Needs the kv capability.

GoDelete(ctx context.Context, id string, params *SessionsDeleteParams) error
Pythondef delete(self, id: str, *, if_match: Optional[Any] = None) -> Any
JavaScriptdelete(id, params = {})
ParameterInTypeAbout
idpath · requiredULID
If-MatchheaderstringThe etag last read. When given and stale, the write is refused with 409 `etag_mismatch`.
StatusBodyMeans
204Deleted.
401ErrorNo studio token, or a revoked or unknown one. Code `unauthenticated`.
403ErrorThe token lacks a capability (`capability_required`, with `details.capability`), the job is not a task the studio may change (`not_a_task`), or the request came from another origin (`bad_origin`).
404ErrorAbsent, deleted, or not the caller's to see. Code `not_found`.
409ErrorCodes: `etag_mismatch`, `name_taken`, `job_finished`, `already_running`, `not_running`, `port_conflict`, `heavy_conflict` (with `details.heavy`), `not_installed`, `conflict`, `in_use`, `missing`, `confirm_required` and `preview_changed` (with `details.preview`), `not_reclaimable`, and from M7: `approval_required` (with `details.approval`), `id_taken`, `not_fetched`, `already_exists`.

POST /sessions/{id}:activate

Set opened_at to now. Changes neither the state nor the etag, nor any process.

Needs the kv capability.

GoActivate(ctx context.Context, id string) error
Pythondef activate(self, id: str) -> Any
JavaScriptactivate(id)
ParameterInTypeAbout
idpath · requiredULID
StatusBodyMeans
204Activated.
401ErrorNo studio token, or a revoked or unknown one. Code `unauthenticated`.
403ErrorThe token lacks a capability (`capability_required`, with `details.capability`), the job is not a task the studio may change (`not_a_task`), or the request came from another origin (`bad_origin`).
404ErrorAbsent, deleted, or not the caller's to see. Code `not_found`.

POST /sessions/{id}:duplicate

Copy a session's state under a new name. The copy has never been opened.

Needs the kv capability.

GoDuplicate(ctx context.Context, id string, body SessionDuplicate) (*Session, error)
Pythondef duplicate(self, id: str, body: Dict[str, Any]) -> Any
JavaScriptduplicate(id, body)
ParameterInTypeAbout
idpath · requiredULID

Request body: SessionDuplicate (application/json)

StatusBodyMeans
201SessionThe copy.
400ErrorThe request is malformed. Codes: `bad_request`, `bad_filter`, `bad_cursor`, `invalid_document`.
401ErrorNo studio token, or a revoked or unknown one. Code `unauthenticated`.
403ErrorThe token lacks a capability (`capability_required`, with `details.capability`), the job is not a task the studio may change (`not_a_task`), or the request came from another origin (`bad_origin`).
404ErrorAbsent, deleted, or not the caller's to see. Code `not_found`.
409ErrorCodes: `etag_mismatch`, `name_taken`, `job_finished`, `already_running`, `not_running`, `port_conflict`, `heavy_conflict` (with `details.heavy`), `not_installed`, `conflict`, `in_use`, `missing`, `confirm_required` and `preview_changed` (with `details.preview`), `not_reclaimable`, and from M7: `approval_required` (with `details.approval`), `id_taken`, `not_fetched`, `already_exists`.
429ErrorA per-studio quota is full. Code `quota_exceeded`, with `details` as QuotaDetails.