RockScript Documentation
Introduction Why and when How does it work Project status Getting started Command line interface Tutorial Language Script versioning License Roadmap Help Services HTTP service API Commands Deploy script Start script Queries Script execution Service SPI End function


Creates a new script version on the server and activates it. The active
script version will be used when starting a new script execution for the script.

@see also Script versioning


Here’s a saveScript example

> POST /command
  Content-Type: application/json
  { "deployScript" :
    { "scriptName" : "Test script",
      "scriptText" : "var a\u003d0;"
< HTTP/1.1 200 OK
  Access-Control-Allow-Origin: *
  { "id":"sv1",
    "scriptName":"Test script",
    "text":"var a\u003d0;",

Request properties

Property name Required? Type Description
scriptId Optional String ID that identifies the script for which this command creates a new version.
scriptName Optional. Default value is Unnamed script String Name that identifies the script for which this command creates a new version. If no scriptId nor scriptName is specified, Unnamed script is used as the scriptName.
scriptText Required String The script text

Response properties

Property name Data type Description
id String ID of the script version
scriptId String ID of the script
scriptName String Name of the script
version Number Sequential version number assigned by the server for this version, starts at 1
text String Text of this script version
active Boolean true if this is the active version, absent if this is not the active version. See Script versioning


The request returns a 400 BAD REQUEST in the following situations

In each of these, a json body will be returned with an error message. For example

Content-Type: application/json
{ "message": "Script s928749 does not exist" }

Save without activate

To create a new version without promoting that new version to the active version, use saveScript as the command name.