> ## Documentation Index > Fetch the complete documentation index at: https://developer.rocket.chat/llms.txt > Use this file to discover all available pages before exploring further. # Execute command's preview item > ### Changelog | Version | Description | | ---------------- | ------------| |3.0.0 | Added `tmid` and `triggerId` fields | |0.65.0 | Added| ## OpenAPI ````json POST /api/v1/commands.preview { "openapi": "3.0.0", "info": { "version": "1.0.0", "title": "Miscellaneous" }, "servers": [ { "url": "https://apiexplorer.support.rocket.chat" } ], "tags": [ { "name": "Commands" }, { "name": "Email Inbox" }, { "name": "Licenses" }, { "name": "Mailer" }, { "name": "Calendar Events" }, { "name": "WhatsApp" }, { "name": "Rasa App" }, { "name": "Jitsi App" } ], "paths": { "/api/v1/commands.preview": { "post": { "tags": [ "Commands" ], "summary": "Execute command's preview item", "description": "### Changelog\n| Version | Description |\n| ---------------- | ------------|\n|3.0.0 | Added `tmid` and `triggerId` fields |\n|0.65.0 | Added|", "operationId": "post-api-v1-commands.preview", "parameters": [ { "$ref": "#/components/parameters/Auth-Token" }, { "$ref": "#/components/parameters/UserId" } ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "command": { "type": "string", "description": "The name of the command to be executed." }, "roomId": { "type": "string", "description": "The ID of the room." }, "tmid": { "type": "string", "description": "The ID of the thread to run the command." }, "params": { "type": "string", "description": "Parameters of the command if required. It is `undefined` by default." }, "triggerId": { "type": "string", "description": "The triggerId generated by the client that allows the command to interact with the UI" }, "previewItem": { "type": "object", "description": "The data of the preview item to be executed by the command", "properties": { "id": { "type": "string", "description": "The ID of the selected preview item" }, "type": { "type": "string", "description": "The type of the selected preview item" }, "value": { "type": "string", "description": "The value of the selected preview item" } }, "required": [ "id", "type", "value" ] } }, "required": [ "command", "roomId", "tmid", "previewItem" ] }, "examples": { "Example": { "value": { "command": "unmute", "roomId": "ByehQjC44FwMeiLbX", "tmid": "Hsj2435g4bvrj4bjh", "params": "@user123", "triggerId": "awovufbukuefzuper", "previewItem": { "id": "nucobdipokaikazia", "type": "image", "value": "https://dev.null/gif" } } } } } } }, "responses": { "200": { "$ref": "#/components/responses/trueSuccess" }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "error": { "type": "string" } } }, "examples": { "Example 1": { "value": { "success": "false", "error": "You must provide a command to run the preview item on." } } } } } }, "401": { "$ref": "#/components/responses/authorizationError" } } } } }, "components": { "parameters": { "Auth-Token": { "name": "X-Auth-Token", "in": "header", "description": "The `authToken` of the authenticated user.", "required": "true", "schema": { "type": "string" }, "example": "RScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f" }, "UserId": { "name": "X-User-Id", "in": "header", "description": "The `userId` of the authenticated user.", "required": "true", "schema": { "type": "string" }, "example": "rbAXPnMktTFbNpwtJ" } }, "responses": { "trueSuccess": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" } } }, "examples": { "Success": { "value": { "success": "true" } } } } } }, "authorizationError": { "description": "Unauthorized", "content": { "application/json": { "schema": { "type": "object", "properties": { "status": { "type": "string" }, "message": { "type": "string" } } }, "examples": { "Authorization Error": { "value": { "status": "error", "message": "You must be logged in to do this." } } } } } } } } } ````