{
  "openapi" : "3.1.0",
  "info" : {
    "description" : "This API allows managing remote commands.",
    "title" : "Remote Commands API (Beta)",
    "version" : "2.0"
  },
  "externalDocs" : {
    "description" : "Trackunit Developer Hub",
    "url" : "https://developers.trackunit.com/"
  },
  "servers" : [ {
    "url" : "https://iris.trackunit.com/api/commands",
    "description" : "Production"
  } ],
  "security" : [ {
    "authorizationBearer" : [ ]
  } ],
  "paths" : {
    "/v2/command-profiles" : {
      "get" : {
        "description" : "Lists the command profiles the caller may view, in every lifecycle state, ordered by the requested column (name ascending unless sort says otherwise). Ids that are unknown or not visible to the caller are omitted. A caller who may view no profiles gets an empty page. Listing a profile says nothing about whether the caller may assign or execute it.",
        "operationId" : "listCommandProfiles",
        "parameters" : [ {
          "description" : "Narrow the result to these command profile ids (at most 100). Omitted or empty means no filter.",
          "in" : "query",
          "name" : "ids",
          "required" : false,
          "schema" : {
            "type" : "array",
            "items" : {
              "type" : "string",
              "format" : "uuid"
            }
          }
        }, {
          "description" : "Zero-based page index (0..N)",
          "in" : "query",
          "name" : "page",
          "required" : false,
          "schema" : {
            "type" : "integer",
            "format" : "int32",
            "default" : 0
          }
        }, {
          "description" : "The size of the page to be returned (1..100)",
          "in" : "query",
          "name" : "size",
          "required" : false,
          "schema" : {
            "type" : "integer",
            "format" : "int32",
            "default" : 20
          }
        }, {
          "description" : "One sort property, with an optional + or - prefix (ascending by default): name, state, commandCount, assetCount, protocols, or updatedAt. Any other property, or more than one, is rejected (case-sensitive).",
          "in" : "query",
          "name" : "sort",
          "required" : false,
          "schema" : {
            "type" : "array",
            "items" : {
              "type" : "string"
            }
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "*/*" : {
                "schema" : {
                  "$ref" : "#/components/schemas/PaginatedCommandProfileResponse"
                }
              }
            },
            "description" : "Ok"
          },
          "400" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ConstraintViolationError"
                }
              }
            },
            "description" : "Bad request"
          },
          "401" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Invalid or missing bearer token in Authorization header"
          },
          "403" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "User not allowed to make this request"
          },
          "404" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Resource not found"
          },
          "500" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Internal server error"
          }
        },
        "summary" : "List command profiles",
        "tags" : [ "Command profiles" ]
      }
    },
    "/v2/command-profiles/{id}" : {
      "get" : {
        "description" : "Fetches a command profile the caller may view. A profile that does not exist and one the caller may not view both return the same 404. Viewing a profile says nothing about whether the caller may assign or execute it.",
        "operationId" : "getCommandProfile",
        "parameters" : [ {
          "description" : "The command profile id",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "type" : "string",
            "format" : "uuid"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "*/*" : {
                "schema" : {
                  "$ref" : "#/components/schemas/CommandProfileResponse"
                }
              }
            },
            "description" : "Ok"
          },
          "400" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ConstraintViolationError"
                }
              }
            },
            "description" : "Bad request"
          },
          "401" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Invalid or missing bearer token in Authorization header"
          },
          "403" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "User not allowed to make this request"
          },
          "404" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Resource not found"
          },
          "500" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Internal server error"
          }
        },
        "summary" : "Get a command profile",
        "tags" : [ "Command profiles" ]
      }
    },
    "/v2/command-profiles/{id}/commands" : {
      "get" : {
        "description" : "Lists the live commands a command profile owns, in every lifecycle state, ordered by name ascending unless a sort is given. Each command carries its stored parameter definitions. Standalone commands are never included. A profile that does not exist and one the caller may not view both return the same 404.",
        "operationId" : "listCommandProfileCommands",
        "parameters" : [ {
          "description" : "The command profile id",
          "in" : "path",
          "name" : "id",
          "required" : true,
          "schema" : {
            "type" : "string",
            "format" : "uuid"
          }
        }, {
          "description" : "Case-insensitive partial match on the command name. The text is matched literally, so % and _ are not wildcards. Omitted or blank means no filter.",
          "in" : "query",
          "name" : "name",
          "required" : false,
          "schema" : {
            "type" : "string"
          }
        }, {
          "description" : "Zero-based page index (0..N)",
          "in" : "query",
          "name" : "page",
          "required" : false,
          "schema" : {
            "type" : "integer",
            "format" : "int32",
            "default" : 0
          }
        }, {
          "description" : "The size of the page to be returned (1..100)",
          "in" : "query",
          "name" : "size",
          "required" : false,
          "schema" : {
            "type" : "integer",
            "format" : "int32",
            "default" : 20
          }
        }, {
          "description" : "name,asc or name,desc. Commands with the same name are ordered by id in the same direction. Defaults to name,asc.",
          "in" : "query",
          "name" : "sort",
          "required" : false,
          "schema" : {
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "*/*" : {
                "schema" : {
                  "$ref" : "#/components/schemas/PaginatedCommandProfileCommandResponse"
                }
              }
            },
            "description" : "Ok"
          },
          "400" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ConstraintViolationError"
                }
              }
            },
            "description" : "Bad request"
          },
          "401" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Invalid or missing bearer token in Authorization header"
          },
          "403" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "User not allowed to make this request"
          },
          "404" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Resource not found"
          },
          "500" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Internal server error"
          }
        },
        "summary" : "List the commands of a command profile",
        "tags" : [ "Command profiles" ]
      }
    },
    "/v2/execution" : {
      "post" : {
        "description" : "Deploys one command to one asset. An unsafe send is refused before anything is queued, with no execution id. The body says which case it was: the account is not allowed, the asset is not configured for this command, or a parameter is outside the allowed range.",
        "operationId" : "executeRemoteCommand",
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/ExecuteCommandRequest"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "201" : {
            "content" : {
              "*/*" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ExecuteCommandResponse"
                }
              }
            },
            "description" : "Created"
          },
          "400" : {
            "content" : {
              "application/json" : {
                "examples" : {
                  "assetNotConfigured" : {
                    "description" : "assetNotConfigured",
                    "summary" : "The asset is not configured",
                    "value" : {
                      "message" : "The asset is not configured for this command"
                    }
                  },
                  "parameterOutsideRange" : {
                    "description" : "parameterOutsideRange",
                    "summary" : "A parameter is outside the allowed range",
                    "value" : {
                      "message" : "A parameter is outside the allowed range"
                    }
                  }
                },
                "schema" : {
                  "$ref" : "#/components/schemas/ConstraintViolationError"
                }
              }
            },
            "description" : "Refused before anything is queued, with no execution id. The body says whether the asset is not configured for this command, or a parameter is outside the allowed range."
          },
          "401" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Invalid or missing bearer token in Authorization header"
          },
          "403" : {
            "content" : {
              "application/json" : {
                "examples" : {
                  "accountNotAllowed" : {
                    "description" : "accountNotAllowed",
                    "summary" : "The account is not allowed",
                    "value" : {
                      "message" : "The account is not allowed to send this command"
                    }
                  }
                },
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "The account is not allowed to send this command. Nothing is queued and no execution id is returned."
          },
          "404" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Resource not found"
          },
          "500" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Internal server error"
          }
        },
        "summary" : "Executes a deployment of single command to an asset",
        "tags" : [ "Remote Commands Execution API v2.0" ]
      }
    },
    "/v2/name/{commandName}/parameters" : {
      "get" : {
        "description" : "Retrieves the parameter list for a command by **name**. This path exists for **legacy** commands, which are identified by `commandName` rather than `commandId`. For **new** commands, use `GET /v2/{commandId}/parameters` instead (typically when `commandTypeLegacy` is absent on the command).",
        "operationId" : "getCommandParametersByName",
        "parameters" : [ {
          "description" : "The command name (legacy string identifier).",
          "in" : "path",
          "name" : "commandName",
          "required" : true,
          "schema" : {
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "*/*" : {
                "schema" : {
                  "$ref" : "#/components/schemas/CommandParameterResponses"
                }
              }
            },
            "description" : "Ok"
          },
          "400" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ConstraintViolationError"
                }
              }
            },
            "description" : "Bad request"
          },
          "401" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Invalid or missing bearer token in Authorization header"
          },
          "403" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "User not allowed to make this request"
          },
          "404" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Resource not found"
          },
          "500" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Internal server error"
          }
        },
        "summary" : "Retrieve parameter list for a command by name",
        "tags" : [ "Remote Commands API v2.0" ]
      }
    },
    "/v2/restrictions" : {
      "get" : {
        "description" : "This endpoint retrieves a paginated list of commands by filtering by its restrictions.",
        "operationId" : "getCommandsByRestrictions",
        "parameters" : [ {
          "in" : "query",
          "name" : "assetId",
          "required" : false,
          "schema" : {
            "type" : "string",
            "format" : "uuid"
          }
        }, {
          "in" : "query",
          "name" : "commandName",
          "required" : false,
          "schema" : {
            "type" : "string"
          }
        }, {
          "in" : "query",
          "name" : "serialNumber",
          "required" : false,
          "schema" : {
            "type" : "string"
          }
        }, {
          "description" : "Zero-based page index (0..N)",
          "example" : 0,
          "in" : "query",
          "name" : "page",
          "required" : false,
          "schema" : {
            "type" : "integer",
            "format" : "int32",
            "default" : 0,
            "minimum" : 0
          }
        }, {
          "description" : "The size of the page to be returned",
          "example" : 20,
          "in" : "query",
          "name" : "size",
          "required" : false,
          "schema" : {
            "type" : "integer",
            "format" : "int32",
            "default" : 20,
            "minimum" : 1
          }
        }, {
          "description" : "Sort order: `property` (ascending by default), `+property` (ascending), `-property` (descending).",
          "in" : "query",
          "name" : "sort",
          "required" : false,
          "schema" : {
            "type" : "array",
            "items" : {
              "type" : "string"
            }
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "*/*" : {
                "schema" : {
                  "$ref" : "#/components/schemas/PaginatedCommandResponse"
                }
              }
            },
            "description" : "Ok"
          },
          "400" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ConstraintViolationError"
                }
              }
            },
            "description" : "Bad request"
          },
          "401" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Invalid or missing bearer token in Authorization header"
          },
          "403" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "User not allowed to make this request"
          },
          "404" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Resource not found"
          },
          "500" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Internal server error"
          }
        },
        "summary" : "Retrieve a paginated list of commands by filtering by its restrictions",
        "tags" : [ "Remote Commands API v2.0" ]
      }
    },
    "/v2/statuses/latest" : {
      "get" : {
        "description" : "This endpoint retrieves the latest command status using the execution ID received for the executed command.",
        "operationId" : "getLatestCommandStatus",
        "parameters" : [ {
          "description" : "Unique identifier of the command execution",
          "in" : "query",
          "name" : "executionId",
          "required" : true,
          "schema" : {
            "type" : "string",
            "format" : "uuid"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "*/*" : {
                "schema" : {
                  "$ref" : "#/components/schemas/CommandStatusResponse"
                }
              }
            },
            "description" : "Ok"
          },
          "400" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ConstraintViolationError"
                }
              }
            },
            "description" : "Bad request"
          },
          "401" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Invalid or missing bearer token in Authorization header"
          },
          "403" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "User not allowed to make this request"
          },
          "404" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Resource not found"
          },
          "500" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Internal server error"
          }
        },
        "summary" : "Get a latest command execution status for the provided execution id",
        "tags" : [ "Remote Commands Status API v2.0" ]
      }
    },
    "/v2/{commandId}/parameters" : {
      "get" : {
        "description" : "This endpoint retrieves a command's parameter list, using its commandId.",
        "operationId" : "getParametersByCommandId",
        "parameters" : [ {
          "in" : "path",
          "name" : "commandId",
          "required" : true,
          "schema" : {
            "type" : "string",
            "format" : "uuid"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "*/*" : {
                "schema" : {
                  "$ref" : "#/components/schemas/CommandParameterResponses"
                }
              }
            },
            "description" : "Ok"
          },
          "400" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ConstraintViolationError"
                }
              }
            },
            "description" : "Bad request"
          },
          "401" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Invalid or missing bearer token in Authorization header"
          },
          "403" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "User not allowed to make this request"
          },
          "404" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Resource not found"
          },
          "500" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Internal server error"
          }
        },
        "summary" : "Retrieve a parameter list from a command by the commandId",
        "tags" : [ "Remote Commands API v2.0" ]
      }
    }
  },
  "components" : {
    "schemas" : {
      "CommandParameter" : {
        "type" : "object",
        "properties" : {
          "allowedValues" : {
            "type" : "array",
            "items" : {
              "$ref" : "#/components/schemas/CommandParameterAllowedValue"
            },
            "uniqueItems" : true
          },
          "bitPositionInTemplate" : {
            "type" : "integer",
            "format" : "int32"
          },
          "byteValueFormat" : {
            "type" : "string",
            "description" : "Format used for BYTE values only. Defaults to DECIMAL for BYTE parameters and is ignored for non-BYTE parameter types.",
            "enum" : [ "DECIMAL", "HEX" ]
          },
          "id" : {
            "type" : "string",
            "format" : "uuid"
          },
          "name" : {
            "type" : "string"
          },
          "numberOfBits" : {
            "type" : "integer",
            "format" : "int32"
          },
          "order" : {
            "type" : "integer",
            "format" : "int32"
          },
          "overwritable" : {
            "type" : "boolean"
          },
          "rawFrameParameterByteOrder" : {
            "type" : "string",
            "description" : "Byte order used only when a SHORT or INTEGER parameter is encoded into a raw-frame WRITE writeFrameTemplate payload slot.",
            "enum" : [ "BIG_ENDIAN", "LITTLE_ENDIAN" ]
          },
          "required" : {
            "type" : "boolean"
          },
          "value" : {
            "type" : "string"
          },
          "valueRange" : {
            "$ref" : "#/components/schemas/CommandParameterValueRange"
          },
          "valueType" : {
            "type" : "string",
            "enum" : [ "BYTE", "SHORT", "INTEGER", "LONG", "FLOAT", "DOUBLE", "BYTE_ARRAY", "STRING", "RANGE" ]
          }
        },
        "required" : [ "name", "overwritable", "required", "valueType" ]
      },
      "CommandParameterAllowedValue" : {
        "type" : "object",
        "properties" : {
          "commandParameterId" : {
            "type" : "string",
            "format" : "uuid"
          },
          "id" : {
            "type" : "string",
            "format" : "uuid"
          },
          "label" : {
            "type" : "string"
          },
          "value" : {
            "type" : "string"
          }
        },
        "required" : [ "commandParameterId", "id", "label", "value" ]
      },
      "CommandParameterResponses" : {
        "type" : "object",
        "properties" : {
          "parameters" : {
            "type" : "array",
            "items" : {
              "$ref" : "#/components/schemas/CommandParameter"
            },
            "uniqueItems" : true
          }
        }
      },
      "CommandParameterValueRange" : {
        "type" : "object",
        "properties" : {
          "id" : {
            "type" : "string",
            "format" : "uuid"
          },
          "max" : {
            "type" : "number",
            "format" : "double"
          },
          "min" : {
            "type" : "number",
            "format" : "double"
          },
          "step" : {
            "type" : "number",
            "format" : "double"
          }
        },
        "required" : [ "max", "min", "step" ]
      },
      "CommandProfileCommandResponse" : {
        "type" : "object",
        "properties" : {
          "canDescriptors" : {
            "$ref" : "#/components/schemas/SubcollectionMetadata"
          },
          "commandTypeLegacy" : {
            "type" : "string",
            "enum" : [ "J1939_WRITE", "MODBUS_WRITE", "MODBUS_WRITE_WITH_FEEDBACK", "J1939_WRITE_ON_DEMAND", "J1939_READ_ON_DEMAND", "MODBUS_READ" ]
          },
          "description" : {
            "type" : "string"
          },
          "id" : {
            "type" : "string",
            "format" : "uuid"
          },
          "isImmediate" : {
            "type" : "boolean"
          },
          "modbusDescriptors" : {
            "$ref" : "#/components/schemas/SubcollectionMetadata"
          },
          "name" : {
            "type" : "string"
          },
          "parameterDefinitions" : {
            "type" : "array",
            "description" : "The stored parameter definitions, as returned by the command's parameters link.",
            "items" : {
              "$ref" : "#/components/schemas/CommandParameter"
            },
            "uniqueItems" : true
          },
          "parameters" : {
            "$ref" : "#/components/schemas/SubcollectionMetadata"
          },
          "preconditions" : {
            "$ref" : "#/components/schemas/SubcollectionMetadata"
          },
          "protocolType" : {
            "type" : "string",
            "enum" : [ "CAN", "MODBUS" ]
          },
          "queueable" : {
            "type" : "boolean"
          },
          "restrictions" : {
            "$ref" : "#/components/schemas/SubcollectionMetadata"
          },
          "updatedAt" : {
            "type" : "string",
            "format" : "date-time"
          }
        },
        "required" : [ "description", "id", "name" ]
      },
      "CommandProfileResponse" : {
        "type" : "object",
        "description" : "A command profile: a named, account-owned collection of remote commands.",
        "properties" : {
          "commandCount" : {
            "type" : "integer",
            "format" : "int64",
            "description" : "Number of live commands on the command profile. The same for every caller."
          },
          "description" : {
            "type" : [ "string", "null" ],
            "description" : "Optional description of the command profile."
          },
          "id" : {
            "type" : "string",
            "format" : "uuid",
            "description" : "Unique identifier of the command profile."
          },
          "name" : {
            "type" : "string",
            "description" : "Human-readable name of the command profile."
          },
          "ownerAccountId" : {
            "type" : "string",
            "format" : "uuid",
            "description" : "Identifier of the account that owns the command profile."
          },
          "state" : {
            "type" : "string",
            "description" : "Lifecycle state of the command profile.",
            "enum" : [ "IN_DEVELOPMENT", "RELEASED", "DEPRECATED" ]
          }
        }
      },
      "CommandResponse" : {
        "type" : "object",
        "properties" : {
          "canDescriptors" : {
            "$ref" : "#/components/schemas/SubcollectionMetadata"
          },
          "commandTypeLegacy" : {
            "type" : "string",
            "enum" : [ "J1939_WRITE", "MODBUS_WRITE", "MODBUS_WRITE_WITH_FEEDBACK", "J1939_WRITE_ON_DEMAND", "J1939_READ_ON_DEMAND", "MODBUS_READ" ]
          },
          "description" : {
            "type" : "string"
          },
          "id" : {
            "type" : "string",
            "format" : "uuid"
          },
          "isImmediate" : {
            "type" : "boolean"
          },
          "modbusDescriptors" : {
            "$ref" : "#/components/schemas/SubcollectionMetadata"
          },
          "name" : {
            "type" : "string"
          },
          "parameters" : {
            "$ref" : "#/components/schemas/SubcollectionMetadata"
          },
          "preconditions" : {
            "$ref" : "#/components/schemas/SubcollectionMetadata"
          },
          "protocolType" : {
            "type" : "string",
            "enum" : [ "CAN", "MODBUS" ]
          },
          "queueable" : {
            "type" : "boolean"
          },
          "restrictions" : {
            "$ref" : "#/components/schemas/SubcollectionMetadata"
          },
          "updatedAt" : {
            "type" : "string",
            "format" : "date-time"
          }
        },
        "required" : [ "description", "id", "name" ]
      },
      "CommandStatusResponse" : {
        "type" : "object",
        "properties" : {
          "cancelReason" : {
            "type" : "string",
            "description" : "Why a queued command was cancelled. Null unless commandStatusType is QUEUED_CANCELLED."
          },
          "cancelledBy" : {
            "type" : "string",
            "description" : "Who cancelled a queued command. Null unless commandStatusType is QUEUED_CANCELLED."
          },
          "commandExecutionId" : {
            "type" : "string",
            "format" : "uuid",
            "description" : "Unique identifier of the associated command execution"
          },
          "commandStatusType" : {
            "type" : "string",
            "description" : "Type of the command status (e.g., PENDING, SUCCESS, FAILED)",
            "enum" : [ "COMMAND_RECEIVED", "QUEUED", "QUEUED_CANCELLED", "PENDING", "SENT_TO_DEVICE", "SENDING_TO_DEVICE_FAILED", "RECEIVED_BY_DEVICE", "RECEIVED_BY_DEVICE_WITH_ERROR", "CANCELLED_ON_GATEWAY", "EXPIRED_ON_GATEWAY", "EXPIRED_ON_DEVICE", "PRECONDITION_FAILED_ON_DEVICE", "SEND_FROM_DEVICE_TO_MACHINE_FAILED", "DEVICE_QUEUE_FULL", "MACHINE_RESPONSE_TIMEOUT", "COMMAND_DROPPED_BY_DEVICE", "MACHINE_OPERATION_FAILED", "INVALID_MEMORY_ACCESS_DATA", "MACHINE_BUSY", "MACHINE_INVALID_KEY", "COMMAND_GROUP_OPERATION_ERROR", "EXCEPTION", "INVALID_RESPONSE", "INTERNAL_ERROR", "SUCCESS" ]
          },
          "id" : {
            "type" : "string",
            "format" : "uuid",
            "description" : "Unique identifier of the command status entry"
          },
          "operationType" : {
            "type" : "string",
            "description" : "Type of operation performed: READ or WRITE",
            "enum" : [ "READ", "WRITE" ]
          },
          "parsedResponse" : {
            "type" : "string",
            "description" : "Human-readable parsed response derived from the raw response"
          },
          "rawResponse" : {
            "type" : "string",
            "description" : "Raw response received from the telematics device"
          },
          "timeStamp" : {
            "type" : "string",
            "format" : "date-time",
            "description" : "Timestamp when the status was recorded"
          }
        },
        "required" : [ "commandExecutionId", "commandStatusType", "timeStamp" ]
      },
      "ConstraintViolationError" : {
        "type" : "object",
        "properties" : {
          "code" : {
            "type" : [ "string", "null" ],
            "description" : "Alphanumeric code (snake case) describing use case specific error"
          },
          "message" : {
            "type" : "string",
            "description" : "Detailed description of error"
          },
          "properties" : {
            "type" : [ "object", "null" ],
            "additionalProperties" : { },
            "description" : "Additional properties to be included in the error response"
          },
          "status" : {
            "type" : "integer",
            "format" : "int32",
            "description" : "HTTP status code"
          },
          "violations" : {
            "type" : "array",
            "items" : {
              "$ref" : "#/components/schemas/Violation"
            }
          }
        }
      },
      "DefaultError" : {
        "type" : "object",
        "properties" : {
          "code" : {
            "type" : [ "string", "null" ],
            "description" : "Alphanumeric code (snake case) describing use case specific error"
          },
          "message" : {
            "type" : "string",
            "description" : "Detailed description of error"
          },
          "properties" : {
            "type" : [ "object", "null" ],
            "additionalProperties" : { },
            "description" : "Additional properties to be included in the error response"
          },
          "status" : {
            "type" : "integer",
            "format" : "int32",
            "description" : "HTTP status code"
          }
        }
      },
      "ExecuteCommandRequest" : {
        "type" : "object",
        "properties" : {
          "assetId" : {
            "type" : "string",
            "format" : "uuid",
            "description" : "Asset identifier on which commands should be executed"
          },
          "commandId" : {
            "type" : "string",
            "format" : "uuid",
            "description" : "Id of command for execution"
          },
          "commandName" : {
            "type" : "string",
            "description" : "Command Name for execution"
          },
          "commandTypeLegacy" : {
            "type" : "string",
            "description" : "Onei3 Legacy command type identifier",
            "enum" : [ "J1939_WRITE", "MODBUS_WRITE", "MODBUS_WRITE_WITH_FEEDBACK", "J1939_WRITE_ON_DEMAND", "J1939_READ_ON_DEMAND", "MODBUS_READ" ]
          },
          "operationType" : {
            "type" : "string",
            "description" : "Operation type: READ or WRITE",
            "enum" : [ "READ", "WRITE" ]
          },
          "parameterId" : {
            "type" : "string",
            "format" : "uuid",
            "description" : "Command parameter identifier for execution"
          },
          "priority" : {
            "type" : "string",
            "description" : "Command priority",
            "enum" : [ "NORMAL", "HIGH" ]
          },
          "sendImmediately" : {
            "type" : "boolean",
            "description" : "Determine if commands should be executed immediately"
          },
          "serialNumber" : {
            "type" : "string",
            "description" : "Telematics device serial number on which commands should be executed"
          },
          "timeoutInSeconds" : {
            "type" : "integer",
            "format" : "int32",
            "default" : 1080,
            "description" : "Timeout in seconds to execute commands."
          },
          "value" : {
            "type" : "string",
            "description" : "Value to be executed for a write operation"
          }
        },
        "required" : [ "commandId" ]
      },
      "ExecuteCommandResponse" : {
        "type" : "object",
        "properties" : {
          "commandExecutionIds" : {
            "type" : "array",
            "items" : {
              "type" : "string",
              "format" : "uuid"
            }
          },
          "statuses" : {
            "type" : "array",
            "description" : "Initial status of each execution, in the same order as commandExecutionIds. QUEUED when the command was placed on the queue. COMMAND_RECEIVED when it was sent.",
            "items" : {
              "type" : "string",
              "enum" : [ "COMMAND_RECEIVED", "QUEUED", "QUEUED_CANCELLED", "PENDING", "SENT_TO_DEVICE", "SENDING_TO_DEVICE_FAILED", "RECEIVED_BY_DEVICE", "RECEIVED_BY_DEVICE_WITH_ERROR", "CANCELLED_ON_GATEWAY", "EXPIRED_ON_GATEWAY", "EXPIRED_ON_DEVICE", "PRECONDITION_FAILED_ON_DEVICE", "SEND_FROM_DEVICE_TO_MACHINE_FAILED", "DEVICE_QUEUE_FULL", "MACHINE_RESPONSE_TIMEOUT", "COMMAND_DROPPED_BY_DEVICE", "MACHINE_OPERATION_FAILED", "INVALID_MEMORY_ACCESS_DATA", "MACHINE_BUSY", "MACHINE_INVALID_KEY", "COMMAND_GROUP_OPERATION_ERROR", "EXCEPTION", "INVALID_RESPONSE", "INTERNAL_ERROR", "SUCCESS" ]
            }
          }
        }
      },
      "PaginatedCommandProfileCommandResponse" : {
        "type" : "object",
        "properties" : {
          "content" : {
            "type" : "array",
            "description" : "The page content as a list.",
            "items" : {
              "$ref" : "#/components/schemas/CommandProfileCommandResponse"
            }
          },
          "number" : {
            "type" : "integer",
            "format" : "int32",
            "description" : "The number of the current page."
          },
          "numberOfElements" : {
            "type" : "integer",
            "format" : "int32",
            "description" : "The number of elements currently on this page."
          },
          "size" : {
            "type" : "integer",
            "format" : "int32",
            "description" : "The size of the page."
          },
          "totalElements" : {
            "type" : "integer",
            "format" : "int64",
            "description" : "The total number of elements."
          },
          "totalPages" : {
            "type" : "integer",
            "format" : "int32",
            "description" : "The number of total pages."
          }
        }
      },
      "PaginatedCommandProfileResponse" : {
        "type" : "object",
        "properties" : {
          "content" : {
            "type" : "array",
            "description" : "The page content as a list.",
            "items" : {
              "$ref" : "#/components/schemas/CommandProfileResponse"
            }
          },
          "number" : {
            "type" : "integer",
            "format" : "int32",
            "description" : "The number of the current page."
          },
          "numberOfElements" : {
            "type" : "integer",
            "format" : "int32",
            "description" : "The number of elements currently on this page."
          },
          "size" : {
            "type" : "integer",
            "format" : "int32",
            "description" : "The size of the page."
          },
          "totalElements" : {
            "type" : "integer",
            "format" : "int64",
            "description" : "The total number of elements."
          },
          "totalPages" : {
            "type" : "integer",
            "format" : "int32",
            "description" : "The number of total pages."
          }
        }
      },
      "PaginatedCommandResponse" : {
        "type" : "object",
        "properties" : {
          "content" : {
            "type" : "array",
            "description" : "The page content as a list.",
            "items" : {
              "$ref" : "#/components/schemas/CommandResponse"
            }
          },
          "number" : {
            "type" : "integer",
            "format" : "int32",
            "description" : "The number of the current page."
          },
          "numberOfElements" : {
            "type" : "integer",
            "format" : "int32",
            "description" : "The number of elements currently on this page."
          },
          "size" : {
            "type" : "integer",
            "format" : "int32",
            "description" : "The size of the page."
          },
          "totalElements" : {
            "type" : "integer",
            "format" : "int64",
            "description" : "The total number of elements."
          },
          "totalPages" : {
            "type" : "integer",
            "format" : "int32",
            "description" : "The number of total pages."
          }
        }
      },
      "SubcollectionMetadata" : {
        "type" : "object",
        "properties" : {
          "href" : {
            "type" : "string"
          },
          "totalElements" : {
            "type" : "integer",
            "format" : "int32"
          }
        }
      },
      "Violation" : {
        "type" : "object",
        "properties" : {
          "field" : {
            "type" : "string"
          },
          "message" : {
            "type" : "string"
          }
        }
      }
    },
    "securitySchemes" : {
      "authorizationBearer" : {
        "bearerFormat" : "JWT",
        "scheme" : "bearer",
        "type" : "http"
      }
    }
  }
}