Remote CLI invocation
POST
/system/cli
const url = 'https://example.com/api/v1/system/cli';const options = { method: 'POST', headers: { cookie: 'grommunioAuthJwt=<grommunioAuthJwt>', 'Content-Type': 'application/json' }, body: '{"command":"example","mode":"exec","color":false,"fs":{"additionalProperty":"example"}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/v1/system/cli \ --header 'Content-Type: application/json' \ --cookie grommunioAuthJwt=<grommunioAuthJwt> \ --data '{ "command": "example", "mode": "exec", "color": false, "fs": { "additionalProperty": "example" } }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”X-Csrf-Token
string
CSRF Token
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
command
required
CLI command to execute
string
mode
CLI mode (execute or complete)
string
color
Enable terminal colors
boolean
fs
If not null, enable filesystem redirection. Each property is a file path
object
key
additional properties
Content of the file
string
Responses
Section titled “Responses”Execution successful
Media typeapplication/json
object
code
Command exit code (exec mode only)
integer
stdout
Command output (exec mode only)
string
fs
object
key
additional properties
object
mode
Mode the file was opened with
string
conf
Configuration key the file path was derived from
string
content
Content of the file
string
completions
Possible command completions (complete mode only)
Array<string>
Examplegenerated
{ "code": 1, "stdout": "example", "fs": { "additionalProperty": { "mode": "example", "conf": "example", "content": "example" } }, "completions": [ "example" ]}Validation of input parameters failed
Media typeapplication/json
object
message
string
errors
List of errors encountered during validation
Array<string>
Examplegenerated
{ "message": "example", "errors": [ "example" ]}An error occurred while processing the request
Media typeapplication/json
object
message
String representation of the exception
string
Examplegenerated
{ "message": "example"}