---
updatedAt: 2026-06-12T14:47:10.000Z
agentTools:
  projectIndex: https://docs.formant.io/llms.txt
---

# Query

Query undelivered commands.
Resource: commands
Authorized roles: viewer

# OpenAPI definition

```json
{
  "components": {
    "schemas": {
      "FileInfo": {
        "properties": {
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "name": {
            "minLength": 1,
            "maxLength": 256,
            "type": "string"
          },
          "url": {
            "format": "url",
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "id"
        ]
      },
      "CommandParameter": {
        "properties": {
          "value": {
            "maxLength": 1024,
            "type": "string",
            "description": "Enter your parameter and value. This string will be passed along with your command."
          },
          "meta": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "You can use this to add many parameters in a more structured way."
          },
          "scrubberTime": {
            "format": "date-time",
            "type": "string",
            "description": "Timestamp associated with this command."
          },
          "files": {
            "items": {
              "$ref": "#/components/schemas/FileInfo"
            },
            "type": "array",
            "maxItems": 5,
            "minItems": 1,
            "description": "File(s) to be sent as a parameter with your command. Up to five files allowed."
          }
        },
        "type": "object",
        "required": [
          "scrubberTime"
        ]
      },
      "Command": {
        "properties": {
          "organizationId": {
            "format": "uuid",
            "type": "string",
            "description": "ID of the organization in which you want to create this new command instance."
          },
          "deviceId": {
            "format": "uuid",
            "type": "string",
            "description": "ID of the device on which this command should run."
          },
          "userId": {
            "format": "uuid",
            "type": "string",
            "nullable": true,
            "description": "ID of the user who issued this command."
          },
          "commandTemplateId": {
            "format": "uuid",
            "type": "string",
            "nullable": true
          },
          "eventTriggerId": {
            "format": "uuid",
            "type": "string",
            "description": "Used by Formant agent only, ignore."
          },
          "command": {
            "type": "string",
            "description": "Function, script, or routine to execute."
          },
          "parameter": {
            "$ref": "#/components/schemas/CommandParameter"
          },
          "deliveredAt": {
            "format": "date-time",
            "type": "string",
            "nullable": true,
            "description": "Used by Formant agent only, ignore."
          },
          "canceledAt": {
            "format": "date-time",
            "type": "string",
            "nullable": true,
            "description": "Used by Formant agent only, ignore."
          },
          "respondedAt": {
            "format": "date-time",
            "type": "string",
            "nullable": true,
            "description": "Used by Formant agent only, ignore."
          },
          "success": {
            "type": "boolean",
            "nullable": true,
            "description": "Used by Formant agent only, ignore."
          },
          "streamName": {
            "type": "string",
            "nullable": true,
            "description": "Used by Formant agent only, ignore."
          },
          "streamType": {
            "type": "string",
            "enum": [
              "bitset",
              "localization",
              "point cloud",
              "location",
              "file",
              "health",
              "transform tree",
              "battery",
              "video",
              "numeric set",
              "json",
              "image",
              "numeric",
              "text"
            ],
            "nullable": true,
            "description": "Used by Formant agent only, ignore."
          },
          "tags": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "nullable": true,
            "description": "Tags associated with this command instance."
          },
          "lambdaUri": {
            "type": "string",
            "nullable": true
          },
          "expiredAt": {
            "format": "date-time",
            "type": "string",
            "nullable": true
          },
          "retryable": {
            "type": "boolean",
            "nullable": true
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "deviceId",
          "command",
          "parameter"
        ]
      },
      "CommandQuery": {
        "properties": {
          "organizationId": {
            "format": "uuid",
            "type": "string"
          },
          "deviceId": {
            "format": "uuid",
            "type": "string"
          },
          "createdAfter": {
            "format": "date-time",
            "type": "string"
          },
          "limit": {
            "type": "integer",
            "format": "int64",
            "minimum": 1,
            "maximum": 500
          },
          "destination": {
            "type": "string",
            "enum": [
              "agent",
              "cloud"
            ]
          },
          "next": {}
        },
        "type": "object"
      },
      "CommandListResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/Command"
            },
            "type": "array"
          },
          "next": {}
        },
        "type": "object",
        "required": [
          "items"
        ]
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  },
  "info": {
    "title": "Formant admin-api",
    "version": "1.357.8"
  },
  "openapi": "3.0.0",
  "paths": {
    "/commands/query": {
      "post": {
        "operationId": "CommandController.query",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CommandQuery"
              }
            }
          },
          "description": "CommandQuery",
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandListResponse"
                }
              }
            },
            "description": ""
          }
        },
        "summary": "Query",
        "tags": [
          "Command"
        ],
        "description": "Query undelivered commands.\nResource: commands\nAuthorized roles: viewer",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    }
  },
  "servers": [
    {
      "url": "https://api.formant.io/v1/admin"
    }
  ]
}
```