> For the complete documentation index, see [llms.txt](https://docs.xibosignage.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.xibosignage.com/developer/integrate/openapi/command.md).

# Command

Commands

## Command Search

> Search this users Commands

```json
{"openapi":"3.0.0","info":{"title":"Xibo API","version":"4.5"},"tags":[{"name":"command","description":"Commands"}],"servers":[{"url":"/api"}],"paths":{"/command":{"get":{"tags":["command"],"summary":"Command Search","description":"Search this users Commands","operationId":"commandSearch","parameters":[{"name":"commandId","in":"query","description":"Filter by Command Id","required":false,"schema":{"type":"integer"}},{"name":"command","in":"query","description":"Filter by Command Name","required":false,"schema":{"type":"string"}},{"name":"code","in":"query","description":"Filter by Command Code","required":false,"schema":{"type":"string"}},{"name":"useRegexForName","in":"query","description":"Flag (0,1). When filtering by multiple commands in command filter, should we use regex?","required":false,"schema":{"type":"integer"}},{"name":"useRegexForCode","in":"query","description":"Flag (0,1). When filtering by multiple codes in code filter, should we use regex?","required":false,"schema":{"type":"integer"}},{"name":"logicalOperatorName","in":"query","description":"When filtering by multiple commands in command filter, which logical operator should be used? AND|OR","required":false,"schema":{"type":"string"}},{"name":"logicalOperatorCode","in":"query","description":"When filtering by multiple codes in code filter, which logical operator should be used? AND|OR","required":false,"schema":{"type":"string"}},{"name":"type","in":"query","description":"Filter by player type (e.g. android, windows, linux, chromeOS, lg). Returns commands available on that type plus commands with no type restriction.","required":false,"schema":{"type":"string"}},{"name":"sortBy","in":"query","description":"Specifies which field the results are sorted by. Used together with sortDir","required":false,"schema":{"type":"string","enum":["commandId","command","code","description","groupsWithPermissions"]}},{"name":"sortDir","in":"query","description":"Sort direction","required":false,"schema":{"type":"string","enum":["asc","desc"]}}],"responses":{"200":{"description":"successful operation","headers":{"X-Total-Count":{"description":"The total number of records","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Command"}}}}}}}}},"components":{"schemas":{"Command":{"description":"Class Command","properties":{"commandId":{"description":"Command Id","type":"integer"},"command":{"description":"Command Name","type":"string"},"code":{"description":"Unique Code","type":"string"},"description":{"description":"Description","type":"string"},"userId":{"description":"User Id","type":"integer"},"commandString":{"description":"Command String","type":"string"},"validationString":{"description":"Validation String","type":"string"},"displayProfileId":{"description":"DisplayProfileId if specific to a Display Profile","type":"integer"},"commandStringDisplayProfile":{"description":"Command String specific to the provided DisplayProfile","type":"string"},"validationStringDisplayProfile":{"description":"Validation String specific to the provided DisplayProfile","type":"string"},"availableOn":{"description":"A comma separated list of player types this command is available on","type":"string"},"createAlertOn":{"description":"Define if execution of this command should create an alert on success, failure, always or never.","type":"string"},"createAlertOnDisplayProfile":{"description":"Create Alert On specific to the provided DisplayProfile."},"groupsWithPermissions":{"description":"A comma separated list of groups/users with permissions to this Command","type":"string"}},"type":"object"}}}}
```

## Command Add

> Add a Command

```json
{"openapi":"3.0.0","info":{"title":"Xibo API","version":"4.5"},"tags":[{"name":"command","description":"Commands"}],"servers":[{"url":"/api"}],"paths":{"/command":{"post":{"tags":["command"],"summary":"Command Add","description":"Add a Command","operationId":"commandAdd","requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"required":["command","code"],"properties":{"command":{"description":"The Command Name","type":"string"},"description":{"description":"A description for the command","type":"string"},"code":{"description":"A unique code for this command","type":"string"},"commandString":{"description":"The Command String for this Command. Can be overridden on Display Settings.","type":"string"},"validationString":{"description":"The Validation String for this Command. Can be overridden on Display Settings.","type":"string"},"availableOn":{"description":"An array of Player types this Command is available on, empty for all.","type":"string"},"createAlertOn":{"description":"On command execution, when should a Display alert be created? success, failure, always or never","type":"string"}},"type":"object"}}}},"responses":{"201":{"description":"successful operation","headers":{"Location":{"description":"Location of the new record","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Command"}}}}}}}},"components":{"schemas":{"Command":{"description":"Class Command","properties":{"commandId":{"description":"Command Id","type":"integer"},"command":{"description":"Command Name","type":"string"},"code":{"description":"Unique Code","type":"string"},"description":{"description":"Description","type":"string"},"userId":{"description":"User Id","type":"integer"},"commandString":{"description":"Command String","type":"string"},"validationString":{"description":"Validation String","type":"string"},"displayProfileId":{"description":"DisplayProfileId if specific to a Display Profile","type":"integer"},"commandStringDisplayProfile":{"description":"Command String specific to the provided DisplayProfile","type":"string"},"validationStringDisplayProfile":{"description":"Validation String specific to the provided DisplayProfile","type":"string"},"availableOn":{"description":"A comma separated list of player types this command is available on","type":"string"},"createAlertOn":{"description":"Define if execution of this command should create an alert on success, failure, always or never.","type":"string"},"createAlertOnDisplayProfile":{"description":"Create Alert On specific to the provided DisplayProfile."},"groupsWithPermissions":{"description":"A comma separated list of groups/users with permissions to this Command","type":"string"}},"type":"object"}}}}
```

## Search Commands by ID

> Get the Command object specified by the provided commandId

```json
{"openapi":"3.0.0","info":{"title":"Xibo API","version":"4.5"},"tags":[{"name":"command","description":"Commands"}],"servers":[{"url":"/api"}],"paths":{"/command/{commandId}":{"get":{"tags":["command"],"summary":"Search Commands by ID","description":"Get the Command object specified by the provided commandId","operationId":"commandSearchById","parameters":[{"name":"commandId","in":"path","description":"Numeric ID of the Command to get","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Command"}}}}}}}},"components":{"schemas":{"Command":{"description":"Class Command","properties":{"commandId":{"description":"Command Id","type":"integer"},"command":{"description":"Command Name","type":"string"},"code":{"description":"Unique Code","type":"string"},"description":{"description":"Description","type":"string"},"userId":{"description":"User Id","type":"integer"},"commandString":{"description":"Command String","type":"string"},"validationString":{"description":"Validation String","type":"string"},"displayProfileId":{"description":"DisplayProfileId if specific to a Display Profile","type":"integer"},"commandStringDisplayProfile":{"description":"Command String specific to the provided DisplayProfile","type":"string"},"validationStringDisplayProfile":{"description":"Validation String specific to the provided DisplayProfile","type":"string"},"availableOn":{"description":"A comma separated list of player types this command is available on","type":"string"},"createAlertOn":{"description":"Define if execution of this command should create an alert on success, failure, always or never.","type":"string"},"createAlertOnDisplayProfile":{"description":"Create Alert On specific to the provided DisplayProfile."},"groupsWithPermissions":{"description":"A comma separated list of groups/users with permissions to this Command","type":"string"}},"type":"object"}}}}
```

## Edit Command

> Edit the provided command

```json
{"openapi":"3.0.0","info":{"title":"Xibo API","version":"4.5"},"tags":[{"name":"command","description":"Commands"}],"servers":[{"url":"/api"}],"paths":{"/command/{commandId}":{"put":{"tags":["command"],"summary":"Edit Command","description":"Edit the provided command","operationId":"commandEdit","parameters":[{"name":"commandId","in":"path","description":"The Command Id to Edit","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"required":["command"],"properties":{"command":{"description":"The Command Name","type":"string"},"description":{"description":"A description for the command","type":"string"},"commandString":{"description":"The Command String for this Command. Can be overridden on Display Settings.","type":"string"},"validationString":{"description":"The Validation String for this Command. Can be overridden on Display Settings.","type":"string"},"availableOn":{"description":"An array of Player types this Command is available on, empty for all.","type":"string"},"createAlertOn":{"description":"On command execution, when should a Display alert be created? success, failure, always or never","type":"string"}},"type":"object"}}}},"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Command"}}}}}}}},"components":{"schemas":{"Command":{"description":"Class Command","properties":{"commandId":{"description":"Command Id","type":"integer"},"command":{"description":"Command Name","type":"string"},"code":{"description":"Unique Code","type":"string"},"description":{"description":"Description","type":"string"},"userId":{"description":"User Id","type":"integer"},"commandString":{"description":"Command String","type":"string"},"validationString":{"description":"Validation String","type":"string"},"displayProfileId":{"description":"DisplayProfileId if specific to a Display Profile","type":"integer"},"commandStringDisplayProfile":{"description":"Command String specific to the provided DisplayProfile","type":"string"},"validationStringDisplayProfile":{"description":"Validation String specific to the provided DisplayProfile","type":"string"},"availableOn":{"description":"A comma separated list of player types this command is available on","type":"string"},"createAlertOn":{"description":"Define if execution of this command should create an alert on success, failure, always or never.","type":"string"},"createAlertOnDisplayProfile":{"description":"Create Alert On specific to the provided DisplayProfile."},"groupsWithPermissions":{"description":"A comma separated list of groups/users with permissions to this Command","type":"string"}},"type":"object"}}}}
```

## Delete Command

> Delete the provided command

```json
{"openapi":"3.0.0","info":{"title":"Xibo API","version":"4.5"},"tags":[{"name":"command","description":"Commands"}],"servers":[{"url":"/api"}],"paths":{"/command/{commandId}":{"delete":{"tags":["command"],"summary":"Delete Command","description":"Delete the provided command","operationId":"commandDelete","parameters":[{"name":"commandId","in":"path","description":"The Command Id to Delete","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"successful operation"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.xibosignage.com/developer/integrate/openapi/command.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
