---
title: "Promote script version"
method: POST
path: "/api/scripts/{handle}/{host}/{slug}/versions/{versionId}/promote"
---

# Promote script version

`POST /api/scripts/{handle}/{host}/{slug}/versions/{versionId}/promote`

## Request

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

Make a version the one the script runs, which is also how you roll back to an older one. A draft stops being a draft.

## 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.
- `versionId` string, uuid, required

## Request body

- object
  - `bypass_check` boolean: Skip the authoring-rules check a version goes live under. Only when a check refused this version and you judge the refusal wrong.
  - `bypass_evals` boolean: Promote even though this version refuses the args of some active evals of the script, or some did not pass on it. For an urgent fix that cannot wait for the evals.

## Response `200`

OK

- ScriptVersion
  - `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
  - `content` string: The version's source. Omitted on an official script unless you belong to the project that owns it.
  - `input_schema` object, required
  - `output_schema` object, required
  - `libraries` string[]: The libraries the code imports, by host (`lib:<host>`). Read from the code, so withheld with it on an official script from anyone outside the project that owns it.

## Other responses

- `400`: Invalid request
- `401`: Not authenticated
- `403`: Forbidden
- `404`: Not found
- `409`: The script is archived, the draft was forked from an older version, or the draft changed while the authoring-rules check read it (promote it again).

---

[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)
