---
title: "Run a reusable or inline script"
method: POST
path: "/api/scripts/run"
tags: ["Scripts"]
---

# Run a reusable or inline script

`POST /api/scripts/run`

Inline source skips typecheck and is auto-saved as a scratch script only on success.

## Request body

- object
  - `name` string
  - `source` string
  - `args` unknown
  - `intent` string
  - `scope` 'global' | 'agent'
  - `fsMode` 'none' | 'workspace-rw'
  - `idempotencyKey` string

## Response `200`

Script run completed

## Other responses

- `400` — Validation error
- `404` — Script not found
- `501` — workspace-rw scripts are not supported in v1

---

[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/92a1dcbd2fc7/schema)
