Everstack
API ReferenceSandboxList Code Contexts

List Code Contexts

GET/v1/sandbox/{sandbox_id}/code/contexts
GET/v1/sandbox/{'{sandbox_id}'}/code/contexts

Your 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

ParameterTypeRequiredDescription
sandbox_idstringYesSandbox ID or name

Query Parameters

ParameterTypeRequiredDescription
languagestringNoFilter contexts by programming language (e.g. "python")

Responses

200 Success

PropertyTypeDescription
contextsobject[]Array of code context objects
contexts[].idstringUnique ID of the code context
contexts[].languagestringProgramming language of the REPL context
contexts[].sandbox_idstringID of the sandbox this context belongs to
contexts[].created_atstringISO 8601 timestamp when the context was created

default An unexpected error response.

PropertyTypeDescription
codeinteger
messagestring
detailsobject[]

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"
    }
  ]
}