> ## Documentation Index
> Fetch the complete documentation index at: https://docs.axilio.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Get a run's script

> 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.

Minimum role required: Viewer


## OpenAPI

````yaml /api-reference/openapi-backend.json get /runs/{run_id}/script
openapi: 3.1.0
info:
  description: Axilio backend HTTP API.
  title: Axilio API
  version: 0.155.0
servers:
  - url: https://api.axilio.ai/api/v1
    description: Production
security: []
tags:
  - name: Agents
  - name: API Keys
  - name: Billing
  - name: Conversations
  - name: Files
  - name: Messages
  - name: Models
  - name: Organization
  - name: Phones
  - name: Runs
  - name: Sessions
  - name: Skill
  - name: Usage
  - name: Webhooks
paths:
  /runs/{run_id}/script:
    get:
      tags:
        - Runs
      summary: Get a run's script
      description: >-
        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.
      operationId: runs_get_script
      parameters:
        - description: The run's id.
          in: path
          name: run_id
          required: true
          schema:
            description: The run's id.
            format: uuid
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentRunScript'
          description: OK
        '403':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/V2ErrorModel'
          description: Forbidden
        '404':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/V2ErrorModel'
          description: Not Found
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/V2ErrorModel'
          description: Unprocessable Entity
        '500':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/V2ErrorModel'
          description: Internal Server Error
      security:
        - apiKeyAuth: []
components:
  schemas:
    AgentRunScript:
      additionalProperties: false
      description: >-
        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.
      properties:
        cells:
          description: The cells one by one.
          items:
            $ref: '#/components/schemas/AgentRunScriptCell'
          type:
            - array
            - 'null'
        partial:
          description: >-
            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.
          type: boolean
        script:
          description: The cells as one Python file, each headed by its number and status.
          type: string
      required:
        - script
        - cells
        - partial
      type: object
    V2ErrorModel:
      additionalProperties: false
      description: >-
        Error response, following RFC 9457 (Problem Details for HTTP APIs).
        Returned with a application/problem+json content type.
      properties:
        detail:
          description: >-
            A human-readable explanation specific to this occurrence of the
            problem.
          examples:
            - Property foo is required but is missing.
          type: string
        errors:
          description: Optional list of individual error details
          items:
            $ref: '#/components/schemas/V2ErrorDetail'
          type:
            - array
            - 'null'
        instance:
          description: >-
            A URI reference that identifies the specific occurrence of the
            problem.
          examples:
            - https://example.com/error-log/abc123
          format: uri
          type: string
        status:
          description: HTTP status code
          examples:
            - 400
          format: int64
          type: integer
        title:
          description: >-
            A short, human-readable summary of the problem type. This value
            should not change between occurrences of the error.
          examples:
            - Bad Request
          type: string
        type:
          default: about:blank
          description: A URI reference to human-readable documentation for the error.
          examples:
            - https://example.com/errors/example
          format: uri
          type: string
      type: object
    AgentRunScriptCell:
      additionalProperties: false
      description: One cell a run executed.
      properties:
        cell:
          description: The cell's number in the run, from 1.
          format: int64
          type: integer
        code:
          description: The cell's code.
          type: string
        status:
          description: 'How the cell ended: ok, error, or running while it has not.'
          enum:
            - ok
            - error
            - running
          type: string
      required:
        - cell
        - code
        - status
      type: object
    V2ErrorDetail:
      additionalProperties: false
      description: >-
        One specific problem within an error response, locating the offending
        part of the request.
      properties:
        location:
          description: >-
            Where the error occurred, e.g. 'body.items[3].tags' or
            'path.thing-id'
          type: string
        message:
          description: Error message text
          type: string
        value:
          description: The value at the given location
      type: object
  securitySchemes:
    apiKeyAuth:
      description: Customer API key (axl_ prefix).
      in: header
      name: X-Axilio-Api-Key
      type: apiKey

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.