UpdScript¶
Info
PUT https://{some_domain}/script
Updates an existing script.
Rules:
- owner may update own private and public scripts
- staff sessions may update any script
- regular users cannot update чужой public script
Authorization¶
All requests must include a JWT token in Authorization.
Allowed roles: USER, MANAGER, ADMIN, DEALER.
Request¶
Content-Type: application/json
Body Parameters¶
| Field | Type | Required | Description |
|---|---|---|---|
id |
int | Yes | Script ID |
name |
string | Yes | Script name |
script |
string | Yes | Script source code |
description |
string | No | Description |
kind |
string | Yes | indicator, robot, strategy, widget |
language |
string | Yes | stscript, javascript |
visibility |
string | Yes | private, public |
autostart |
int | No | 0 or 1 |
enabled |
int | No | 0 or 1 |
Success 200¶
{
"id": 42,
"login": 1001,
"name": "My MA v2",
"script": "input length = 50",
"description": "updated version",
"kind": "indicator",
"language": "stscript",
"visibility": "public",
"autostart": 1,
"enabled": 1,
"created_time": 1777196331,
"updated_time": 1777197000
}