Skip to main content
Server Scripts & Files

Create a server script

Asynchronous Request

Pass scriptId as your account script id, a library script id, or the slug string returned with scripts from GET /scripts or GET /account/scripts. Library scripts are pulled into your account automatically when deployed.

POST
/servers/{serverSlug}/scripts
Authorizationstringheaderrequired

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

serverSlugstringrequired

Slug of the server

Body

application/json

User script to be created

executeImmediatelybooleandefault:false

If script should be executed immediately after deployment. Requires makeScriptExecutable is set to true.

makeScriptExecutablebooleandefault:false

Whether the script file should be made executable

pathstringrequired

Absolute path and filename of deployment. Must start with a forward slash (/). If path doesn't exist it will be created.Existing files will be overwritten. Example: /root/myscript.sh

scriptIdinteger | stringrequired

ID or slug of the account or library script to deploy. If you pass a Script Library ID or slug, the script is automatically pulled into your Account Scripts.

Response

application/json

Server script deployment initiated

X-Callback-IDstringheader

CallbackID

createdstring

Creation date/time

idinteger

Script ID

lastRunstring | null

Date/time of the last run

lastRunCallbackIdstring | null

Callback ID of the last script run

namestring

Script name

pathstring

Script path