---
title: "Get a run's script"
method: GET
path: "/runs/{run_id}/script"
tags: ["Runs"]
---

# Get a run's script

`GET /runs/{run_id}/script`

## Request

- Base URL: `https://api.axilio.ai/api/v1`
- URL: `https://api.axilio.ai/api/v1/runs/{run_id}/script`
- Auth: API key in header `X-Axilio-Api-Key`
- TypeScript: <https://skmtc.dev/axilioai/apis/axilio-api-2/docs/runs/:run_id/script/get.ts> (a function with typed inputs; its response is checked against the schema)

Returns every cell the run executed, in order, as one Python file and one by one, failed and exploratory cells included. A code run's first cell is its revision's script. The script is kept with the run's data, so it outlives the transcript; when that record is missing, the cells are rebuilt from what remains of the transcript and partial is true. 404 when there is nothing to build it from.

## Path parameters

- `run_id` string, uuid, required: The run's id.

## Response `200`

OK

- AgentRunScript: Every cell a run executed, in order, failed and exploratory ones included: the raw material for a clean script. A code run's first cell is its revision's script.
  - `cells` AgentRunScriptCell[], nullable, required: The cells one by one.
    - `cell` integer, required: The cell's number in the run, from 1.
    - `code` string, required: The cell's code.
    - `status` 'ok' | 'error' | 'running', required: How the cell ended: ok, error, or running while it has not.
  - `partial` boolean, required: True when the cells may not be all the run executed: the run's script record was missing and the cells were rebuilt from what remains of its transcript and, for a code run, its revision, or the record was never finished because the run is still going or its phone stopped mid-run. Such a script can miss cells, the last one included.
  - `script` string, required: The cells as one Python file, each headed by its number and status.

## Other responses

- `403`: Forbidden
- `404`: Not Found
- `422`: Unprocessable Entity
- `500`: Internal Server Error

## Changes

- **2026-11-02** `62aa324803a7`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/axilioai/apis/axilio-api-2/changes/runs/:run_id/script/get.md)

---

[API](https://skmtc.dev/axilioai/apis/axilio-api-2.md) - [All operations](https://skmtc.dev/axilioai/apis/axilio-api-2/llms.txt) - [OpenAPI document](https://skmtc.dev/axilioai/apis/axilio-api-2/revisions/62aa324803a7?raw)
