List Code Contexts
GET
/v1/sandbox/{sandbox_id}/code/contextsGET
/v1/sandbox/{'{sandbox_id}'}/code/contextsYour instance endpoint, shown on the instance page in the dashboard. Each instance has its own host; there is no shared API host.
Description
Returns all persistent REPL code contexts associated with the specified sandbox. Optionally filter by programming language using the language query parameter.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
sandbox_id | string | Yes | Sandbox ID or name |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
language | string | No | Filter contexts by programming language (e.g. "python") |
Responses
200 Success
| Property | Type | Description |
|---|---|---|
contexts | object[] | Array of code context objects |
contexts[].id | string | Unique ID of the code context |
contexts[].language | string | Programming language of the REPL context |
contexts[].sandbox_id | string | ID of the sandbox this context belongs to |
contexts[].created_at | string | ISO 8601 timestamp when the context was created |
default An unexpected error response.
| Property | Type | Description |
|---|---|---|
code | integer | |
message | string | |
details | object[] |
Request
curl -X GET "https://{instance}.{region}.everstack.ai/v1/sandbox/{sandbox_id}/code/contexts?language=python" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"const sandboxId = "your-sandbox-id";
const params = new URLSearchParams({ language: "python" });
const response = await fetch(
`https://{instance}.{region}.everstack.ai/v1/sandbox/${sandboxId}/code/contexts?${params}`,
{
method: "GET",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
}
);
const data = await response.json();import requests
sandbox_id = "your-sandbox-id"
response = requests.get(
f"https://{instance}.{region}.everstack.ai/v1/sandbox/{sandbox_id}/code/contexts",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
params={"language": "python"},
)
data = response.json()Response
{
"contexts": [
{
"id": "string",
"language": "python",
"sandbox_id": "string",
"created_at": "string"
}
]
}{
"code": 0,
"message": "string",
"details": [
{
"@type": "string"
}
]
}
