---
title: "Iframe Integration: Sending Commands"
slug: "iframe-integration-sending-commands"
description: "Learn to send commands via Iframe in Rocket Chat. Extend secure integration and enhance embedded collaboration."
updated: 2025-12-24T05:56:33Z
published: 2025-12-24T05:56:33Z
---

> ## 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.

# Iframe Integration: Sending Commands

When integrating an iframe into Rocket.Chat, you can also send commands to the embedded content using the `postMessage` Rocket.Chat API. It allows you to interact with the content in real time and perform various actions.

## Available commands

| Command | Params | Description |
| --- | --- | --- |
| go | - `path` string | Change url |
| login-with-token | - `token` string | Allow login with token |
| call-custom-oauth-login | - `service` string | Allow login via oauth methods |
| set-user-status | - `status` string | Set the status of the user |
| logout |  | Log the user out of their current session |

Here is an example of how to send a command through a Rocket.Chat iframe:

```javascript
document.querySelector('iframe').contentWindow.postMessage({
  externalCommand: 'go',
  path: '/admin/General'
}, '*')
```

Another useful example is setting the user status in an iframe embedded in Rocket.Chat:

```javascript
document.querySelector('iframe').contentWindow.postMessage({
  externalCommand: 'set-user-status',
  status: 'away'
}, '*')
```

The `externalCommand` field is used to send commands to the embedded content.

> [!NOTE]
> On versions before 8.0, the `event` parameter was also accepted instead of `externalCommand`. From version 8.0 onwards, only the `externalCommand` parameter is supported.
