> ## Documentation Index > Fetch the complete documentation index at: https://learn.servitly.com/llms.txt > Use this file to discover all available pages before exploring further. # Get commands by thing-definition > Returns the list of commands of a specific thing-definition.
A command is a remote operation that can be executed on a thing (for instance start, stop or reset), described by its parameters, by the mapping used to deliver them to the product and by the conditions that define when it is enabled and when it is running.
Set includeInherited to true to obtain also the commands inherited from the parent thing-definitions. ## OpenAPI ````json GET /inventory/thingDefinitions/{thingDefinitionId}/commands { "openapi": "3.1.0", "info": { "title": "Servitly DPS API", "version": "1.0.0" }, "servers": [ { "url": "https://api.servitly-sandbox.com", "description": "[AWS SANDBOX]" }, { "url": "https://api.servitly.com", "description": "[AWS PRODUCTION Ireland]" }, { "url": "https://api-ap.servitly.com", "description": "[AWS Hong Kong]" }, { "url": "https://azapi.servitly-dev.com", "description": "[AZURE DEV Frankfurt]" }, { "url": "https://azapi.servitly-staging.com", "description": "[AZURE STAGING Frankfurt]" }, { "url": "https://azapi.servitly.com", "description": "[AZURE PRODUCTION Frankfurt]" } ], "security": [ { "bearerAuth": [] } ], "tags": [ { "name": "ACTIONS" }, { "name": "ALERTS" }, { "name": "API GATEWAY" }, { "name": "AUTHENTICATION" }, { "name": "AUTHORIZATIONS" }, { "name": "CUSTOMERS" }, { "name": "DATA IMPORT / EXPORT" }, { "name": "EVENTS" }, { "name": "LOCATIONS" }, { "name": "MAINTENANCE" }, { "name": "MAPPING" }, { "name": "METRIC DATA" }, { "name": "MOBILE APP" }, { "name": "ORGANIZATION" }, { "name": "PARTNERS" }, { "name": "PRODUCT MODELS" }, { "name": "SPARE PARTS" }, { "name": "STATISTICS" }, { "name": "STORE ORDERS" }, { "name": "SUBSCRIPTIONS" }, { "name": "SUBSCRIPTIONS (OLD)" }, { "name": "THING CONTROL" }, { "name": "THING DEFINITIONS" }, { "name": "THING MANAGEMENT" }, { "name": "THINGS" }, { "name": "TICKETS" }, { "name": "USER TYPES" }, { "name": "USERS" }, { "name": "WORK SESSIONS" } ], "paths": { "/inventory/thingDefinitions/{thingDefinitionId}/commands": { "get": { "summary": "Get commands by thing-definition", "description": "Returns the list of commands of a specific thing-definition.
A command is a remote operation that can be executed on a thing (for instance start, stop or reset), described by its parameters, by the mapping used to deliver them to the product and by the conditions that define when it is enabled and when it is running.
Set includeInherited to true to obtain also the commands inherited from the parent thing-definitions.", "tags": [ "THING DEFINITIONS" ], "parameters": [ { "$ref": "#/components/parameters/tenantNameHeader" }, { "$ref": "#/components/parameters/includeInherited" }, { "in": "path", "name": "thingDefinitionId", "required": "true", "schema": { "$ref": "#/components/schemas/ObjectId" }, "description": "The thing-definition identifier." } ], "responses": { "200": { "description": "Successful operation.", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Command" } } } } }, "401": { "$ref": "#/components/responses/NotAuthenticated" }, "403": { "$ref": "#/components/responses/NotAuthorized" }, "404": { "$ref": "#/components/responses/NotFound" }, "429": { "$ref": "#/components/responses/ApiLimit" }, "500": { "$ref": "#/components/responses/IntError" } } } } }, "components": { "parameters": { "tenantNameHeader": { "in": "header", "name": "X-Servitly-Tenant", "required": "true", "schema": { "type": "string", "example": "{{tenantName}}" }, "description": "The name of the tenant (e.g. acme)." }, "includeInherited": { "in": "query", "name": "includeInherited", "required": "false", "schema": { "type": "boolean" }, "description": "If true, the response includes the elements inherited from parent thing definitions." } }, "schemas": { "ObjectId": { "type": "string", "example": "abcd1234", "minimum": "1", "description": "The object identifier (e.g. 6620e4bb42541977c406b984)." }, "Command": { "type": "object", "properties": { "id": { "type": "string", "description": "The command object identifier.", "readOnly": "true" }, "thingDefinition": { "writeOnly": "true", "description": "The thing-definition identifier associated with the command.", "allOf": [ { "$ref": "#/components/schemas/IdRef" } ] }, "name": { "type": "string", "description": "The command name." }, "secure": { "type": "boolean", "description": "The flag indicating whether the command is secured." }, "onCondition": { "description": "The condition that defines the toggle command status.", "allOf": [ { "$ref": "#/components/schemas/Condition" } ] }, "runningCondition": { "description": "The condition that defines whether the command is running.", "allOf": [ { "$ref": "#/components/schemas/Condition" } ] }, "enabledCondition": { "description": "The condition that enables or disables the command button within the page.", "allOf": [ { "$ref": "#/components/schemas/Condition" } ] }, "mapping": { "description": "The command mapping used to send parameters to the thing.", "type": "object", "properties": { "path": { "type": "string", "description": "The command mapping path.", "example": "execute" } } }, "parameters": { "description": "The parameters sent by the command.", "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "description": "The selection item name.", "example": "par1" }, "type": { "type": "string", "description": "The parameter type.", "enum": [ "BOOLEAN", "DOUBLE", "FLOAT", "INTEGER", "LONG", "ARRAY", "STRING" ] }, "value": { "description": "The parameter value." }, "onCondition": { "type": "boolean", "description": "The flag indicating whether the parameter must be sent according to the on-condition status; if omitted, it is always sent." } } } } } }, "IdRef": { "type": "object", "properties": { "id": { "type": "string", "description": "The referenced object identifier.", "example": "1234abcd" } } }, "Condition": { "type": "object", "properties": { "metric": { "description": "The condition metric.", "allOf": [ { "$ref": "#/components/schemas/IdRef" } ] }, "predicate": { "type": "string", "enum": [ "EQUAL", "NOT_EQUAL", "LESS", "GREATER", "LESS_EQUAL", "GREATER_EQUAL" ], "description": "The condition predicate." }, "value": { "type": "string", "description": "The condition value to check." } } } }, "responses": { "NotAuthenticated": { "description": "User not authenticated.", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "description": "The error response.", "example": "User not authenticated" } } } } } }, "NotAuthorized": { "description": "User not authorized.", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "description": "The error response.", "example": "User not authorized" } } } } } }, "NotFound": { "description": "Resource was not found.", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "description": "The error response.", "example": "Resource not found" } } } } } }, "ApiLimit": { "description": "API call rate limit exceeded.", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "description": "The error response.", "example": "API call rate limit exceeded" } } } } } }, "IntError": { "description": "Internal server error.", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "description": "The error response.", "example": "Internal Server Error" } } } } } } }, "securitySchemes": { "bearerAuth": { "type": "http", "scheme": "bearer" } } } } ````