---
title: "Create Or Update Script"
method: POST
path: "/scripts/{script_name}"
tags: ["Scripts"]
---

# Create Or Update Script

`POST /scripts/{script_name}`

Create a new script or update an existing one.

Saves the provided Python source code as a script file in the scripts directory.
If a script with the same name exists, it will be overwritten. The script code
should be a valid Python module that implements the ScriptStrategyBase class.

Use this endpoint to deploy custom scripts, update existing strategy implementations,
or import scripts from external sources.

Note: After uploading a new script, you may need to restart the API server for
the script to be properly loaded into the Python runtime.

## Path parameters

- `script_name` string, required

## Request body

- Script — Request model for creating or updating a V1 strategy script Python file.
  - `content` string, required — Python source code for the script. Should be a valid Python module implementing a strategy class that extends ScriptStrategyBase.

## Response `201`

Successful Response

- object

## Other responses

- `422` — Validation Error

## Changes

- **2026-01-18** `576ec8539f76` — 1 breaking
  - the response's body type/format changed from ``/`` to `object`/`` for status `201`
- **2025-12-20** `1005bcd47280` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/hummingbot/apis/hummingbot-api/changes/scripts/:script_name/post.md)

---

[API](https://skmtc.dev/hummingbot/apis/hummingbot-api.md) · [All operations](https://skmtc.dev/hummingbot/apis/hummingbot-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/hummingbot/hummingbot-api/revisions/576ec8539f76/schema)
