---
title: "List script versions"
method: GET
path: "/api/scripts/{handle}/{host}/{slug}/versions"
---

# List script versions

`GET /api/scripts/{handle}/{host}/{slug}/versions`

## Request

- Base URL: `https://reduck.ai`
- URL: `https://reduck.ai/api/scripts/{handle}/{host}/{slug}/versions`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Key`

List a script's versions, newest first. Read a version on its own to get its code.

## Path parameters

- `handle` string, required: The owner a resource is addressed under: "@username" for a personal scope, or a bare slug for a project.
- `host` string, required: The site the script automates, as a hostname.
- `slug` string, required: The script's unique identifier within its host, unique per owner.

## Query parameters

- `page` integer
- `pageSize` integer
- `draft` 'true' | 'false': Omit for the whole history; "true" for the open drafts, "false" for promoted versions only.

## Response `200`

OK

- PaginatedResponseScriptVersionSummary
  - `data` ScriptVersionSummary[], required
    - `id` string, required
    - `script_id` string, required
    - `version_number` number, required
    - `parent_version_id` string, nullable, required
    - `language` string, required
    - `logged_in` boolean, required
    - `side_effects` 'none' | 'undetermined' | 'write', required
    - `draft` boolean, required
    - `note` string, nullable: Why this version exists. Omitted on an official script unless you belong to the project that owns it, and never carried by the version a script listing embeds.
    - `created_by` object, nullable, required: Who saved this version. Distinct from the script's `author`, which is the OWNER (a user or a project): a project's script is edited by its members one at a time, and this names the one. Null when that account has since been deleted.
      - `handle` string, required
      - `name` string, required
    - `created_at` string, required
    - `execution_count` number, required
    - `last_run_at` string, nullable, required
    - `success_rate` number, nullable, required
    - `avg_time_ms` number, nullable, required
  - `hasNextPage` boolean, required
  - `totalCount` number

## Other responses

- `401`: Not authenticated
- `403`: Forbidden
- `404`: Not found

---

[API](https://skmtc.dev/reduck/apis/reduck-api.md) · [All operations](https://skmtc.dev/reduck/apis/reduck-api/llms.txt) · [OpenAPI document](https://skmtc.dev/reduck/apis/reduck-api/revisions/a573b91206d6?raw)
