> For the complete documentation index, see [llms.txt](https://emotiv.gitbook.io/cortex-library-for-mobile/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://emotiv.gitbook.io/cortex-library-for-mobile/jsonapi/triggervirtualheadsetevent.md).

# triggerVirtualHeadsetEvent

This method lets you trigger an eye action for the facial expression detection.

## Parameters

| Name             | Type     | Required | Description                                                                                    |
| ---------------- | -------- | -------- | ---------------------------------------------------------------------------------------------- |
| cortexToken      | `string` | yes      | A token returned by [authorize](https://emotiv.gitbook.io/cortex-api/authentication/authorize) |
| virtualHeadsetId | `string` | yes      | The `uuid` of a virtual headset.                                                               |
| eyeAction        | `string` | yes      | The value can be "blink", "winkL" or "winkR".                                                  |

## Result

The result is an an object with these fields:

| Name             | Type     | Description                        |
| ---------------- | -------- | ---------------------------------- |
| virtualHeadsetId | `string` | The `uuid` of the virtual headset. |
| eyeAction        | `string` | The action from the request.       |
| message          | `string` | A success message.                 |

## Example

Trigger a blink event.

{% tabs %}
{% tab title="Request" %}

```javascript
{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "triggerVirtualHeadsetEvent",
  "params": {
    "cortexToken": "xxx",
    "virtualHeadsetId": "70e2002f-e4d2-4708-a4d0-8600f2a04842",
    "eyeAction": "blink"
  }
}
```

{% endtab %}

{% tab title="Response" %}

```javascript
{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "virtualHeadsetId": "70e2002f-e4d2-4708-a4d0-8600f2a04842",
    "eyeAction": "blink",
    "message": "Action triggered successfully" 
  }
}
```

{% endtab %}
{% endtabs %}
