---
title: "Archive script"
method: POST
path: "/api/scripts/{handle}/{host}/{slug}/archive"
---

# Archive script

`POST /api/scripts/{handle}/{host}/{slug}/archive`

## Request

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

Archive a script. It vanishes from the cross-owner listing, though a listing scoped to its owner still shows it unless you filter archived ones out. Archiving never frees its host and slug, so no other script can take that identity while it exists, and a public one stays readable by its own.

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

## Response `200`

OK

- ScriptWithVersion
  - `id` string, required
  - `name` string, required
  - `slug` string, required
  - `host` string, required
  - `description` string, required
  - `visibility` 'private' | 'public', required
  - `current_version_id` string, nullable, required
  - `archived_at` string, nullable, required
  - `created_at` string, required
  - `updated_at` string, required
  - `author` ScriptAuthor, required
    - `kind` 'user' | 'project', required
    - `handle` string, required
    - `name` string, required
    - `approval` 'official' | 'trusted' | 'unverified', required
  - `execution_count` number, required
  - `last_run_at` string, nullable, required
  - `success_rate` number, nullable, required
  - `avg_time_ms` number, nullable, required
  - `version_count` number, required
  - `human_required` boolean, required
  - `current_version` ScriptVersion, 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
    - `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

---

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