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

# Promote script lib version

`POST /api/scripts/{handle}/{host}/lib/versions/{version}/promote`

## Request

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

Make a version of a host's lib the latest: every script of the owner that imports `lib:<host>` loads it from its next run. Promoting an older version is the rollback. The owner can, and so can a project member allowed to update its scripts.

## 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 whose lib it is; scripts import it as `lib:<host>`.
- `version` integer, required

## Response `200`

OK

- object
  - `previous_version` number, nullable, required
  - `version_number` number, required
  - `note` string, nullable, required
  - `created_at` string, required
  - `latest` boolean, required
  - `content` string, required

## Other responses

- `400`: Invalid request
- `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)
