[comment]: # ({8961fc33-8961fc33})
# script.create

[comment]: # ({/8961fc33-8961fc33})

[comment]: # ({4ec049c4-4ec049c4})
### Description

`object script.create(object/array scripts)`

This method allows to create new scripts.

[comment]: # ({/4ec049c4-4ec049c4})

[comment]: # ({bcb9a453-bcb9a453})
### Parameters

`(object/array)` Scripts to create.

The method accepts scripts with the [standard script
properties](/manual/api/reference/script/object#script).

[comment]: # ({/bcb9a453-bcb9a453})

[comment]: # ({15216b8d-15216b8d})
### Return values

`(object)` Returns an object containing the IDs of the created scripts
under the `scriptids` property. The order of the returned IDs matches
the order of the passed scripts.

[comment]: # ({/15216b8d-15216b8d})

[comment]: # ({b41637d2-b41637d2})
### Examples

[comment]: # ({/b41637d2-b41637d2})

[comment]: # ({d394757a-d394757a})
#### Create a script

Create a script that will reboot a server. The script will require write
access to the host and will display a configuration message before
running in the frontend.

Request:

``` {.java}
{
    "jsonrpc": "2.0",
    "method": "script.create",
    "params": {
        "name": "Reboot server",
        "command": "reboot server 1",
        "host_access": 3,
        "confirmation": "Are you sure you would like to reboot the server?"
    },
    "auth": "038e1d7b1735c6a5436ee9eae095879e",
    "id": 1
}
```

Response:

``` {.java}
{
    "jsonrpc": "2.0",
    "result": {
        "scriptids": [
            "3"
        ]
    },
    "id": 1
}
```

[comment]: # ({/d394757a-d394757a})

[comment]: # ({8c09f129-8c09f129})
### Source

CScript::create() in *ui/include/classes/api/services/CScript.php*.

[comment]: # ({/8c09f129-8c09f129})
