/lua/var/{name}

A persistent Lua variable.

Get /lua/var/{name}

SecurityApiKey
Request
path Parameters
name
required
string

The name of a persistent Lua variable.

query Parameters
max-depth
integer >= 1

Limit output depth of the response. See Max-Depth.

Example: max-depth=2
filter
string

Response filter string. See Filter-Spec.

Example: filter={foo,bar}
Responses
200

Normal response.

401

Unauthorized response.

get/lua/var/{name}
Request samples
Response samples
application/json
{
  • "result": {
    },
  • "error": "Error message (present if an error occurred)."
}

Replace /lua/var/{name}

SecurityApiKey
Request
path Parameters
name
required
string

The name of a persistent Lua variable.

Request Body schema: application/json
value
string (luaVarNameValue)

The current value of this persistent variable as a JSON-encoded string.

While it is possible to write this value via the WebAPI, Lua scripts generally will also be updating the value as part of their execution, so any change in value may be temporary and whether or not a WebAPI write is detected by the scripts depends on the scripts themselves.

desc
string (luaVarNameDesc)

A brief, user-friendly description of the purpose of this persistent variable. This description is set when the persistent variable is created and is in the language chosen by the author of the Lua script that is created the variable. The string is, therefore, not localized to the user's environment.

Responses
200

Normal response.

401

Unauthorized response.

put/lua/var/{name}
Request samples
application/json
{
  • "result": {
    }
}
Response samples
application/json
{
  • "status": "OK",
  • "error": "Error message (present if an error occurred)."
}

Update /lua/var/{name}

SecurityApiKey
Request
path Parameters
name
required
string

The name of a persistent Lua variable.

Request Body schema: application/json
value
string (luaVarNameValue)

The current value of this persistent variable as a JSON-encoded string.

While it is possible to write this value via the WebAPI, Lua scripts generally will also be updating the value as part of their execution, so any change in value may be temporary and whether or not a WebAPI write is detected by the scripts depends on the scripts themselves.

desc
string (luaVarNameDesc)

A brief, user-friendly description of the purpose of this persistent variable. This description is set when the persistent variable is created and is in the language chosen by the author of the Lua script that is created the variable. The string is, therefore, not localized to the user's environment.

Responses
200

Normal response.

401

Unauthorized response.

post/lua/var/{name}
Request samples
application/json
{
  • "result": {
    }
}
Response samples
application/json
{
  • "status": "OK",
  • "error": "Error message (present if an error occurred)."
}

Delete /lua/var/{name}

Reset to default. See the descriptions of the individual endpoints for their default values. Commonly, arrays and strings are cleared to empty, numbers are cleared to 0, and booleans are cleared to false.

SecurityApiKey
Request
path Parameters
name
required
string

The name of a persistent Lua variable.

Responses
200

Normal response.

401

Unauthorized response.

delete/lua/var/{name}
Request samples
Response samples
application/json
{
  • "status": "OK",
  • "error": "Error message (present if an error occurred)."
}