Skip to main content
GET
/
v1
/
sandboxes
/
{id}
/
code
/
runs
/
{run_id}
Get async code run
import requests

url = "https://api.13-215-85-171.sslip.io/v1/sandboxes/{id}/code/runs/{run_id}"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
{
  "id": "<string>",
  "sandbox_id": "<string>",
  "context_id": "<string>",
  "timeout_secs": 123,
  "created_at": "2023-11-07T05:31:56Z",
  "expires_at": "2023-11-07T05:31:56Z",
  "started_at": "2023-11-07T05:31:56Z",
  "completed_at": "2023-11-07T05:31:56Z",
  "cancel_requested_at": "2023-11-07T05:31:56Z",
  "execution": {
    "results": [
      {
        "text": "<string>",
        "html": "<string>",
        "markdown": "<string>",
        "svg": "<string>",
        "png": "<string>",
        "jpeg": "<string>",
        "pdf": "<string>",
        "latex": "<string>",
        "json": "<unknown>",
        "javascript": "<string>",
        "data": {},
        "is_main_result": true
      }
    ],
    "artifacts": [
      {
        "id": "<string>",
        "context_id": "<string>",
        "mime_type": "<string>",
        "name": "<string>",
        "size_bytes": 123,
        "sha256": "<string>",
        "created_at": "2023-11-07T05:31:56Z",
        "execution_count": 123,
        "expires_at": "2023-11-07T05:31:56Z",
        "preview_url": "<string>",
        "download_url": "<string>",
        "metadata": {}
      }
    ],
    "logs": {
      "stdout": [
        "<string>"
      ],
      "stderr": [
        "<string>"
      ]
    },
    "error": {
      "name": "<string>",
      "value": "<string>",
      "traceback": "<string>"
    },
    "execution_count": 123
  },
  "failure_reason": "<string>"
}

Authorizations

Authorization
string
header
required

API key passed as Bearer token

Path Parameters

id
string
required

Sandbox ID (e.g. sb_a1b2c3d4)

run_id
string
required

Response

Code run

id
string
required
sandbox_id
string
required
context_id
string
required
status
enum<string>
required
Available options:
queued,
running,
succeeded,
failed,
cancelled
timeout_secs
integer
required
created_at
string<date-time>
required
expires_at
string<date-time>
required
started_at
string<date-time> | null
completed_at
string<date-time> | null
cancel_requested_at
string<date-time> | null
execution
object
failure_reason
string | null