Skip to content

Interactive compute sessions, lifecycle management, and token issuance.

GET/workloads/sessions

List sessions

Returns sessions visible to the caller: sessions they own plus sessions belonging to teams they are a member of. Passing teamId narrows the list to that team.

Parameters

teamIdstring
teamId

Filter sessions by team.

Type
string
Example"A1B2C3D4E5"
Min Length
1
Max Length
20
Pattern
"^[A-Z0-9]{1,20}$"
endpoint_typestring
endpoint_type

Filter sessions by endpoint type.

Type
string
Valid values
"spark_connect""marimo"
statusstring
status

Filter sessions by status.

Type
string
Valid values
"pending""active""idle""closed""failed"
limitinteger
limit

The maximum number of items to list.

Type
integer
Format
"int32"
Minimum
0
Maximum
100
Default
100
markerstring
marker

The pagination token returned from the previous list operation.

Type
string
Responses

Responses​

The list of sessions.

application/json
JSON
{
  
"total": 0,
  
"items": [
  
  
{
  
  
  
"id": "A1B2C3D4E5",
  
  
  
"computeInstanceId": "A1B2C3D4E5",
  
  
  
"memberId": "A1B2C3D4E5"
  
  
}
  
],
  
"included": {
  
  
"sessions": [
  
  
  
{
  
  
  
  
"id": "A1B2C3D4E5",
  
  
  
  
"endpointType": "string",
  
  
  
  
"name": "Production Cluster",
  
  
  
  
"status": "string",
  
  
  
  
"workloadId": "A1B2C3D4E5",
  
  
  
  
"teamId": "A1B2C3D4E5",
  
  
  
  
"memberId": "A1B2C3D4E5",
  
  
  
  
"terminationReason": "string",
  
  
  
  
"statusMessage": "string",
  
  
  
  
"connectionInfo": {
  
  
  
  
  
"proxyAuthUrl": "string",
  
  
  
  
  
"grpcEndpoint": "string"
  
  
  
  
},
  
  
  
  
"lastActivityAt": "string",
  
  
  
  
"lastBusyAt": "string",
  
  
  
  
"idleSince": "string",
  
  
  
  
"closedAt": "string",
  
  
  
  
"timeoutAt": "string",
  
  
  
  
"config": {
  
  
  
  
  
"idleTimeoutSeconds": 0,
  
  
  
  
  
"idleCloseDelaySeconds": 0,
  
  
  
  
  
"maxDurationSeconds": 0
  
  
  
  
},
  
  
  
  
"metadata": {
  
  
  
  
  
"additionalProperties": "string"
  
  
  
  
},
  
  
  
  
"createdAt": "string",
  
  
  
  
"updatedAt": "string"
  
  
  
}
  
  
],
  
  
"members": [
  
  
  
{
  
  
  
  
"id": "A1B2C3D4E5",
  
  
  
  
"organizationId": "A1B2C3D4E5",
  
  
  
  
"userId": "A1B2C3D4E5",
  
  
  
  
"name": "string",
  
  
  
  
"email": "alice@example.com",
  
  
  
  
"preferences": {
  
  
  
  
},
  
  
  
  
"invitedByMemberId": "A1B2C3D4E5",
  
  
  
  
"inviteExpiresAt": "string",
  
  
  
  
"inviteAcceptedAt": "string",
  
  
  
  
"lastLoginAt": "string",
  
  
  
  
"lastActiveAt": "string",
  
  
  
  
"isEnabled": true,
  
  
  
  
"accountType": "managed",
  
  
  
  
"createdAt": "string",
  
  
  
  
"createdBy": "A1B2C3D4E5",
  
  
  
  
"updatedAt": "string",
  
  
  
  
"updatedBy": "A1B2C3D4E5"
  
  
  
}
  
  
],
  
  
"workloads": [
  
  
  
{
  
  
  
  
"id": "A1B2C3D4E5",
  
  
  
  
"workloadConfigId": "A1B2C3D4E5",
  
  
  
  
"infraStatus": "string",
  
  
  
  
"shutdownPolicy": "string",
  
  
  
  
"endpoints": {
  
  
  
  
  
"additionalProperties": "string"
  
  
  
  
},
  
  
  
  
"provisionedAt": "string",
  
  
  
  
"cleanedAt": "string",
  
  
  
  
"lastActivityAt": "string",
  
  
  
  
"statusMessage": "string",
  
  
  
  
"createdAt": "string",
  
  
  
  
"createdBy": "A1B2C3D4E5",
  
  
  
  
"updatedAt": "string",
  
  
  
  
"updatedBy": "A1B2C3D4E5",
  
  
  
  
"cleanupFailedAt": "string",
  
  
  
  
"cleanupAbandonedAt": "string"
  
  
  
}
  
  
],
  
  
"workloadConfigs": [
  
  
  
{
  
  
  
  
"id": "A1B2C3D4E5",
  
  
  
  
"name": "Production Cluster",
  
  
  
  
"workloadType": "string",
  
  
  
  
"clusterId": "A1B2C3D4E5",
  
  
  
  
"config": {
  
  
  
  
  
"sail": {
  
  
  
  
  
  
"executionMode": "string",
  
  
  
  
  
  
"maxRetries": 3,
  
  
  
  
  
  
"compute": {
  
  
  
  
  
  
  
"driver": {
  
  
  
  
  
  
  
  
"instanceType": "c8g.2xlarge",
  
  
  
  
  
  
  
  
"ebsConfig": {
  
  
  
  
  
  
  
  
  
"volumeType": "gp3",
  
  
  
  
  
  
  
  
  
"volumeSize": 100,
  
  
  
  
  
  
  
  
  
"iops": 3000,
  
  
  
  
  
  
  
  
  
"throughput": 125,
  
  
  
  
  
  
  
  
  
"deleteOnTermination": true
  
  
  
  
  
  
  
  
}
  
  
  
  
  
  
  
},
  
  
  
  
  
  
  
"worker": {
  
  
  
  
  
  
  
  
"instanceType": "c8g.4xlarge",
  
  
  
  
  
  
  
  
"ebsConfig": {
  
  
  
  
  
  
  
  
  
"volumeType": "gp3",
  
  
  
  
  
  
  
  
  
"volumeSize": 100,
  
  
  
  
  
  
  
  
  
"iops": 3000,
  
  
  
  
  
  
  
  
  
"throughput": 125,
  
  
  
  
  
  
  
  
  
"deleteOnTermination": true
  
  
  
  
  
  
  
  
},
  
  
  
  
  
  
  
  
"maxNodes": 4,
  
  
  
  
  
  
  
  
"capacityType": "on-demand"
  
  
  
  
  
  
  
}
  
  
  
  
  
  
},
  
  
  
  
  
  
"lakesailImageUri": "string",
  
  
  
  
  
  
"libraries": [
  
  
  
  
  
  
  
{
  
  
  
  
  
  
  
  
"pypi": {
  
  
  
  
  
  
  
  
  
"package": "string",
  
  
  
  
  
  
  
  
  
"repo": "string"
  
  
  
  
  
  
  
  
},
  
  
  
  
  
  
  
  
"requirements": {
  
  
  
  
  
  
  
  
  
"source": "string",
  
  
  
  
  
  
  
  
  
"uri": "string"
  
  
  
  
  
  
  
  
},
  
  
  
  
  
  
  
  
"whl": "string"
  
  
  
  
  
  
  
}
  
  
  
  
  
  
],
  
  
  
  
  
  
"extraEnv": {
  
  
  
  
  
  
  
"additionalProperties": {
  
  
  
  
  
  
  
  
"type": "string",
  
  
  
  
  
  
  
  
"value": "string"
  
  
  
  
  
  
  
}
  
  
  
  
  
  
}
  
  
  
  
  
}
  
  
  
  
},
  
  
  
  
"endpointLimits": {
  
  
  
  
  
"spark_connect": 0
  
  
  
  
},
  
  
  
  
"createdAt": "string",
  
  
  
  
"createdBy": "A1B2C3D4E5",
  
  
  
  
"updatedAt": "string",
  
  
  
  
"updatedBy": "A1B2C3D4E5",
  
  
  
  
"catalogs": [
  
  
  
  
  
{
  
  
  
  
  
  
"catalogId": "A1B2C3D4E5",
  
  
  
  
  
  
"name": "Production Cluster"
  
  
  
  
  
}
  
  
  
  
],
  
  
  
  
"defaultCatalogId": "A1B2C3D4E5",
  
  
  
  
"capabilities": {
  
  
  
  
  
"run": {
  
  
  
  
  
  
"allowed": true,
  
  
  
  
  
  
"blocked": {
  
  
  
  
  
  
  
"label": "string",
  
  
  
  
  
  
  
"message": "string"
  
  
  
  
  
  
}
  
  
  
  
  
},
  
  
  
  
  
"storeFiles": {
  
  
  
  
  
  
"allowed": true,
  
  
  
  
  
  
"blocked": {
  
  
  
  
  
  
  
"label": "string",
  
  
  
  
  
  
  
"message": "string"
  
  
  
  
  
  
}
  
  
  
  
  
},
  
  
  
  
  
"warning": {
  
  
  
  
  
  
"label": "string",
  
  
  
  
  
  
"message": "string"
  
  
  
  
  
}
  
  
  
  
},
  
  
  
  
"notebookCount": 0,
  
  
  
  
"jobCount": 0,
  
  
  
  
"activeWorkloadCount": 0
  
  
  
}
  
  
],
  
  
"teams": [
  
  
  
{
  
  
  
  
"team": {
  
  
  
  
  
"id": "A1B2C3D4E5",
  
  
  
  
  
"organizationId": "A1B2C3D4E5",
  
  
  
  
  
"name": "string",
  
  
  
  
  
"createdAt": "string",
  
  
  
  
  
"createdBy": "A1B2C3D4E5",
  
  
  
  
  
"updatedAt": "string",
  
  
  
  
  
"updatedBy": "A1B2C3D4E5",
  
  
  
  
  
"defaultRoleId": "A1B2C3D4E5"
  
  
  
  
},
  
  
  
  
"memberCount": 0
  
  
  
}
  
  
]
  
},
  
"marker": "string"
}
POST/workloads/sessions

Create a session

Creates a new session. Resolves or creates a compute config, finds a reusable compute instance or provisions a new one, and returns the session in pending state. The session transitions to active on the first proxy request after the compute instance is ready.

Request Body​

application/json
JSON
{
  
"endpointType": "string",
  
"name": "Production Cluster",
  
"teamId": "A1B2C3D4E5",
  
"memberId": "A1B2C3D4E5",
  
"config": {
  
  
"idleTimeoutSeconds": 0,
  
  
"idleCloseDelaySeconds": 0,
  
  
"maxDurationSeconds": 0
  
},
  
"metadata": {
  
  
"additionalProperties": "string"
  
},
  
"workloadConfigId": "A1B2C3D4E5",
  
"allowShared": false
}
Responses

Responses​

The session was created successfully.

application/json
JSON
{
  
"id": "A1B2C3D4E5",
  
"endpointType": "string",
  
"name": "Production Cluster",
  
"status": "string",
  
"workloadId": "A1B2C3D4E5",
  
"teamId": "A1B2C3D4E5",
  
"memberId": "A1B2C3D4E5",
  
"terminationReason": "string",
  
"statusMessage": "string",
  
"connectionInfo": {
  
  
"proxyAuthUrl": "string",
  
  
"grpcEndpoint": "string"
  
},
  
"lastActivityAt": "string",
  
"lastBusyAt": "string",
  
"idleSince": "string",
  
"closedAt": "string",
  
"timeoutAt": "string",
  
"config": {
  
  
"idleTimeoutSeconds": 0,
  
  
"idleCloseDelaySeconds": 0,
  
  
"maxDurationSeconds": 0
  
},
  
"metadata": {
  
  
"additionalProperties": "string"
  
},
  
"createdAt": "string",
  
"updatedAt": "string"
}
GET/workloads/sessions/{session}

Describe a session

Returns the session details. For the session owner, includes connectionInfo with the proxy authentication URL (HTTP-transport endpoints) or gRPC endpoint (gRPC-transport endpoints).

Responses

Responses​

The session was retrieved successfully.

application/json
JSON
{
  
"item": {
  
  
"id": "A1B2C3D4E5",
  
  
"computeInstanceId": "A1B2C3D4E5",
  
  
"memberId": "A1B2C3D4E5"
  
},
  
"included": {
  
  
"sessions": [
  
  
  
{
  
  
  
  
"id": "A1B2C3D4E5",
  
  
  
  
"endpointType": "string",
  
  
  
  
"name": "Production Cluster",
  
  
  
  
"status": "string",
  
  
  
  
"workloadId": "A1B2C3D4E5",
  
  
  
  
"teamId": "A1B2C3D4E5",
  
  
  
  
"memberId": "A1B2C3D4E5",
  
  
  
  
"terminationReason": "string",
  
  
  
  
"statusMessage": "string",
  
  
  
  
"connectionInfo": {
  
  
  
  
  
"proxyAuthUrl": "string",
  
  
  
  
  
"grpcEndpoint": "string"
  
  
  
  
},
  
  
  
  
"lastActivityAt": "string",
  
  
  
  
"lastBusyAt": "string",
  
  
  
  
"idleSince": "string",
  
  
  
  
"closedAt": "string",
  
  
  
  
"timeoutAt": "string",
  
  
  
  
"config": {
  
  
  
  
  
"idleTimeoutSeconds": 0,
  
  
  
  
  
"idleCloseDelaySeconds": 0,
  
  
  
  
  
"maxDurationSeconds": 0
  
  
  
  
},
  
  
  
  
"metadata": {
  
  
  
  
  
"additionalProperties": "string"
  
  
  
  
},
  
  
  
  
"createdAt": "string",
  
  
  
  
"updatedAt": "string"
  
  
  
}
  
  
],
  
  
"members": [
  
  
  
{
  
  
  
  
"id": "A1B2C3D4E5",
  
  
  
  
"organizationId": "A1B2C3D4E5",
  
  
  
  
"userId": "A1B2C3D4E5",
  
  
  
  
"name": "string",
  
  
  
  
"email": "alice@example.com",
  
  
  
  
"preferences": {
  
  
  
  
},
  
  
  
  
"invitedByMemberId": "A1B2C3D4E5",
  
  
  
  
"inviteExpiresAt": "string",
  
  
  
  
"inviteAcceptedAt": "string",
  
  
  
  
"lastLoginAt": "string",
  
  
  
  
"lastActiveAt": "string",
  
  
  
  
"isEnabled": true,
  
  
  
  
"accountType": "managed",
  
  
  
  
"createdAt": "string",
  
  
  
  
"createdBy": "A1B2C3D4E5",
  
  
  
  
"updatedAt": "string",
  
  
  
  
"updatedBy": "A1B2C3D4E5"
  
  
  
}
  
  
],
  
  
"workloads": [
  
  
  
{
  
  
  
  
"id": "A1B2C3D4E5",
  
  
  
  
"workloadConfigId": "A1B2C3D4E5",
  
  
  
  
"infraStatus": "string",
  
  
  
  
"shutdownPolicy": "string",
  
  
  
  
"endpoints": {
  
  
  
  
  
"additionalProperties": "string"
  
  
  
  
},
  
  
  
  
"provisionedAt": "string",
  
  
  
  
"cleanedAt": "string",
  
  
  
  
"lastActivityAt": "string",
  
  
  
  
"statusMessage": "string",
  
  
  
  
"createdAt": "string",
  
  
  
  
"createdBy": "A1B2C3D4E5",
  
  
  
  
"updatedAt": "string",
  
  
  
  
"updatedBy": "A1B2C3D4E5",
  
  
  
  
"cleanupFailedAt": "string",
  
  
  
  
"cleanupAbandonedAt": "string"
  
  
  
}
  
  
],
  
  
"workloadConfigs": [
  
  
  
{
  
  
  
  
"id": "A1B2C3D4E5",
  
  
  
  
"name": "Production Cluster",
  
  
  
  
"workloadType": "string",
  
  
  
  
"clusterId": "A1B2C3D4E5",
  
  
  
  
"config": {
  
  
  
  
  
"sail": {
  
  
  
  
  
  
"executionMode": "string",
  
  
  
  
  
  
"maxRetries": 3,
  
  
  
  
  
  
"compute": {
  
  
  
  
  
  
  
"driver": {
  
  
  
  
  
  
  
  
"instanceType": "c8g.2xlarge",
  
  
  
  
  
  
  
  
"ebsConfig": {
  
  
  
  
  
  
  
  
  
"volumeType": "gp3",
  
  
  
  
  
  
  
  
  
"volumeSize": 100,
  
  
  
  
  
  
  
  
  
"iops": 3000,
  
  
  
  
  
  
  
  
  
"throughput": 125,
  
  
  
  
  
  
  
  
  
"deleteOnTermination": true
  
  
  
  
  
  
  
  
}
  
  
  
  
  
  
  
},
  
  
  
  
  
  
  
"worker": {
  
  
  
  
  
  
  
  
"instanceType": "c8g.4xlarge",
  
  
  
  
  
  
  
  
"ebsConfig": {
  
  
  
  
  
  
  
  
  
"volumeType": "gp3",
  
  
  
  
  
  
  
  
  
"volumeSize": 100,
  
  
  
  
  
  
  
  
  
"iops": 3000,
  
  
  
  
  
  
  
  
  
"throughput": 125,
  
  
  
  
  
  
  
  
  
"deleteOnTermination": true
  
  
  
  
  
  
  
  
},
  
  
  
  
  
  
  
  
"maxNodes": 4,
  
  
  
  
  
  
  
  
"capacityType": "on-demand"
  
  
  
  
  
  
  
}
  
  
  
  
  
  
},
  
  
  
  
  
  
"lakesailImageUri": "string",
  
  
  
  
  
  
"libraries": [
  
  
  
  
  
  
  
{
  
  
  
  
  
  
  
  
"pypi": {
  
  
  
  
  
  
  
  
  
"package": "string",
  
  
  
  
  
  
  
  
  
"repo": "string"
  
  
  
  
  
  
  
  
},
  
  
  
  
  
  
  
  
"requirements": {
  
  
  
  
  
  
  
  
  
"source": "string",
  
  
  
  
  
  
  
  
  
"uri": "string"
  
  
  
  
  
  
  
  
},
  
  
  
  
  
  
  
  
"whl": "string"
  
  
  
  
  
  
  
}
  
  
  
  
  
  
],
  
  
  
  
  
  
"extraEnv": {
  
  
  
  
  
  
  
"additionalProperties": {
  
  
  
  
  
  
  
  
"type": "string",
  
  
  
  
  
  
  
  
"value": "string"
  
  
  
  
  
  
  
}
  
  
  
  
  
  
}
  
  
  
  
  
}
  
  
  
  
},
  
  
  
  
"endpointLimits": {
  
  
  
  
  
"spark_connect": 0
  
  
  
  
},
  
  
  
  
"createdAt": "string",
  
  
  
  
"createdBy": "A1B2C3D4E5",
  
  
  
  
"updatedAt": "string",
  
  
  
  
"updatedBy": "A1B2C3D4E5",
  
  
  
  
"catalogs": [
  
  
  
  
  
{
  
  
  
  
  
  
"catalogId": "A1B2C3D4E5",
  
  
  
  
  
  
"name": "Production Cluster"
  
  
  
  
  
}
  
  
  
  
],
  
  
  
  
"defaultCatalogId": "A1B2C3D4E5",
  
  
  
  
"capabilities": {
  
  
  
  
  
"run": {
  
  
  
  
  
  
"allowed": true,
  
  
  
  
  
  
"blocked": {
  
  
  
  
  
  
  
"label": "string",
  
  
  
  
  
  
  
"message": "string"
  
  
  
  
  
  
}
  
  
  
  
  
},
  
  
  
  
  
"storeFiles": {
  
  
  
  
  
  
"allowed": true,
  
  
  
  
  
  
"blocked": {
  
  
  
  
  
  
  
"label": "string",
  
  
  
  
  
  
  
"message": "string"
  
  
  
  
  
  
}
  
  
  
  
  
},
  
  
  
  
  
"warning": {
  
  
  
  
  
  
"label": "string",
  
  
  
  
  
  
"message": "string"
  
  
  
  
  
}
  
  
  
  
},
  
  
  
  
"notebookCount": 0,
  
  
  
  
"jobCount": 0,
  
  
  
  
"activeWorkloadCount": 0
  
  
  
}
  
  
],
  
  
"teams": [
  
  
  
{
  
  
  
  
"team": {
  
  
  
  
  
"id": "A1B2C3D4E5",
  
  
  
  
  
"organizationId": "A1B2C3D4E5",
  
  
  
  
  
"name": "string",
  
  
  
  
  
"createdAt": "string",
  
  
  
  
  
"createdBy": "A1B2C3D4E5",
  
  
  
  
  
"updatedAt": "string",
  
  
  
  
  
"updatedBy": "A1B2C3D4E5",
  
  
  
  
  
"defaultRoleId": "A1B2C3D4E5"
  
  
  
  
},
  
  
  
  
"memberCount": 0
  
  
  
}
  
  
]
  
}
}
DELETE/workloads/sessions/{session}

Close a session

Closes the session immediately. The session transitions to closed and closed_at is set. Infrastructure cleanup (marimo pod, compute instance) is handled asynchronously. Can be called by the session owner, team admin, or org admin.

Responses

Responses​

The session was closed successfully.

POST/workloads/sessions/{session}/token

Issue a session proxy token

Issues a short-lived signed JWT bearer token for authenticating with the session gRPC proxy. Use the grpcEndpoint from the session's connectionInfo as the dial address and pass the token as Authorization: Bearer in the gRPC metadata. The token encodes the session ID and routing target; no additional metadata header is required. Only the session owner can issue a token.

Request Body​

application/json
JSON
{
  
"durationSeconds": 0
}
Responses

Responses​

A bearer token for gRPC proxy access.

application/json
JSON
{
  
"token": "string",
  
"expiresAt": "string"
}
POST/workloads/sessions/{session}/logs/stream

Issue a session log stream

Issues a short-lived token and URL for streaming the session's Sail server log from the customer-side session proxy. Worker pods in cluster mode are not exposed. Returns 409 while the session's pod is not yet running (retry shortly) or when the cluster requires re-provisioning for live logs; 410 when the session's resources have been cleaned up.

Responses

Responses​

Connection details for the session's live log stream.

application/json
JSON
{
  
"url": "string",
  
"token": "string",
  
"expiresAt": "string",
  
"pod": "string"
}
POST/workloads/sessions/{session}/relaunch

Relaunch a closed session

Creates a new session using the same workload configuration as a previously closed or failed session. Useful for restarting a recurring session without having to reconfigure compute settings from scratch.
The original session must be in a terminal state (closed or failed). A brand-new session ID is returned — the original session is not mutated. The caller must be the original session owner.

Responses

Responses​

The session was relaunched successfully.

application/json
JSON
{
  
"id": "A1B2C3D4E5",
  
"endpointType": "string",
  
"name": "Production Cluster",
  
"status": "string",
  
"workloadId": "A1B2C3D4E5",
  
"teamId": "A1B2C3D4E5",
  
"memberId": "A1B2C3D4E5",
  
"terminationReason": "string",
  
"statusMessage": "string",
  
"connectionInfo": {
  
  
"proxyAuthUrl": "string",
  
  
"grpcEndpoint": "string"
  
},
  
"lastActivityAt": "string",
  
"lastBusyAt": "string",
  
"idleSince": "string",
  
"closedAt": "string",
  
"timeoutAt": "string",
  
"config": {
  
  
"idleTimeoutSeconds": 0,
  
  
"idleCloseDelaySeconds": 0,
  
  
"maxDurationSeconds": 0
  
},
  
"metadata": {
  
  
"additionalProperties": "string"
  
},
  
"createdAt": "string",
  
"updatedAt": "string"
}
POST/workloads/sessions/{session}/destroy

Destroy a session's compute infrastructure

Re-runs teardown of the session's compute infrastructure when a previous automatic teardown failed and the workload is stuck in cleanup_failed (for example, the compute cluster was temporarily unreachable). The teardown is re-attempted asynchronously.
When force is true, the failed teardown is instead abandoned: the workload is marked as needing manual cleanup (cleanup_abandoned_at is set) and removed from the user's active view. This does NOT delete the namespace in the customer cluster — the caller acknowledges they will remove it themselves. Use only when the infrastructure is unrecoverable.
Can be called by the session owner, team admin, or org admin.

Request Body​

application/json
JSON
{
  
"force": false
}
Responses

Responses​

The teardown was re-attempted, or the workload was abandoned.

Can't find the answer here? Email us: support@lakesail.com