Sign Up

Sessions

List sessions

GET
/sessions

List interpreter sessions in creation order.

Response Body

application/json
  1. response

GET /sessions response body.

items*array<>

Sessions in creation order.

curl -X GET 'http://sandbox:2280/sessions'
{  "items": [    {      "active": true,      "createdAt": "string",      "cwd": "string",      "id": "string",      "kernel": "shell",      "kernelProcessId": "string",      "processIds": [        "string"      ]    }  ]}

Create a session

POST
/sessions

Create a language interpreter session for subsequent code executions. Supported languages are python, typescript and javascript (case-sensitive). Unknown languages, including an empty string, return 400 UNSUPPORTED_OPERATION before kernel provisioning. Omitting kernel or requesting shell also returns 400 UNSUPPORTED_OPERATION; shell sessions use POST /processes with kind=session.

Request Body

application/json
  1. body

POST /sessions request body.

cwd?|

Initial working directory. Empty uses the sandbox’s default working directory.

env?

Environment overrides applied when the interpreter session starts.

id?|

Optional client-chosen session id. Must be a safe identifier when present.

kernel?|

Interpreter language, exactly python, typescript or javascript (case-sensitive). Unknown values, including an empty string, answer 400 UNSUPPORTED_OPERATION before provisioning; a supported kernel that fails to install or start answers 503 KERNEL_UNAVAILABLE. A language is required: shell, or omitting the field, answers 400 UNSUPPORTED_OPERATION, because shell sessions are created with POST /processes kind=session.

login?boolean

Not supported for interpreter sessions; answers 400 UNSUPPORTED_OPERATION when true.

shell?|

Not supported for interpreter sessions; answers 400 UNSUPPORTED_OPERATION when set.

Response Body

application/json
  1. response

Session information returned by create, list, and get operations.

active*boolean

Whether the interpreter session is active.

createdAt*string

RFC 3339 creation timestamp.

cwd*string

Initial working directory of the interpreter session; changes made by executed code are not reflected here.

id*string

Stable session id.

kernel*KernelKind

Interpreter language.

Value in"shell""python""typescript""javascript"
kernelProcessId*string

Process ID for the session's interpreter.

processIds*array<string>

Member process ids in creation order.

curl -X POST 'http://sandbox:2280/sessions' \  -H 'Content-Type: application/json' \  -d '{}'
{  "active": true,  "createdAt": "string",  "cwd": "string",  "id": "string",  "kernel": "shell",  "kernelProcessId": "string",  "processIds": [    "string"  ]}

Get a session

GET
/sessions/{id}

Fetch a session by id.

Path Parameters

id*string

Session id.

Response Body

application/json
  1. response

Session information returned by create, list, and get operations.

active*boolean

Whether the interpreter session is active.

createdAt*string

RFC 3339 creation timestamp.

cwd*string

Initial working directory of the interpreter session; changes made by executed code are not reflected here.

id*string

Stable session id.

kernel*KernelKind

Interpreter language.

Value in"shell""python""typescript""javascript"
kernelProcessId*string

Process ID for the session's interpreter.

processIds*array<string>

Member process ids in creation order.

curl -X GET 'http://sandbox:2280/sessions/string'
{  "active": true,  "createdAt": "string",  "cwd": "string",  "id": "string",  "kernel": "shell",  "kernelProcessId": "string",  "processIds": [    "string"  ]}

Delete a session

DELETE
/sessions/{id}

Delete an interpreter session and its associated process information.

Path Parameters

id*string

Session id.

Response Body

Session deleted.

curl -X DELETE 'http://sandbox:2280/sessions/string'
Empty