---
title: "Delete a reusable script"
method: DELETE
path: "/api/scripts/{name}"
tags: ["Scripts"]
---

# Delete a reusable script

`DELETE /api/scripts/{name}`

## Path parameters

- `name` string, required

## Query parameters

- `scope` 'global' | 'agent'

## Response `200`

Delete result

- object
  - `deleted` boolean, required

## Other responses

- `400` — Validation error
- `403` — Global delete requires lead agent
- `409` — Script is referenced by an app definition

## Changes

- **2026-08-07** `0375890be8c4` — 1 info
  - added the non-success response with the status `409`
- **2026-08-07** `06cac6a7c5bc` — 3 info
  - added the media type `application/json` for the response with the status `200`
  - added the media type `application/json` for the response with the status `400`
  - added the media type `application/json` for the response with the status `403`

[Change history](https://skmtc.dev/desplega-ai/apis/agent-swarm-api/changes/api/scripts/:name/delete.md)

---

[API](https://skmtc.dev/desplega-ai/apis/agent-swarm-api.md) · [All operations](https://skmtc.dev/desplega-ai/apis/agent-swarm-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/desplega-ai/agent-swarm-api/revisions/81df4899bc59/schema)
