> 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/updatevirtualheadset.md).

# updateVirtualHeadset

This method lets you update a virtual headset that was previously created by [createVirtualHeadset](/cortex-library-for-mobile/jsonapi/createvirtualheadset.md).

## 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 the virtual headset you want to update.                                                 |
| name               | `string`  | no       | See description in [createVirtualHeadset](/cortex-library-for-mobile/jsonapi/createvirtualheadset.md) |
| powerOn            | `boolean` | no       | See description in [createVirtualHeadset](/cortex-library-for-mobile/jsonapi/createvirtualheadset.md) |
| battery            | `number`  | no       | See description in [createVirtualHeadset](/cortex-library-for-mobile/jsonapi/createvirtualheadset.md) |
| cq                 | `object`  | no       | See description in [createVirtualHeadset](/cortex-library-for-mobile/jsonapi/createvirtualheadset.md) |
| pm                 | `object`  | no       | See description in [createVirtualHeadset](/cortex-library-for-mobile/jsonapi/createvirtualheadset.md) |
| preRecordedSamples | `string`  | no       | See description in [createVirtualHeadset](/cortex-library-for-mobile/jsonapi/createvirtualheadset.md) |
| mc                 | `object`  | no       | See description in [createVirtualHeadset](/cortex-library-for-mobile/jsonapi/createvirtualheadset.md) |
| fe                 | `object`  | no       | See description in [createVirtualHeadset](/cortex-library-for-mobile/jsonapi/createvirtualheadset.md) |

## Result

The result is a [Virtual headset object](/cortex-library-for-mobile/jsonapi/virtual-headset-object.md).

## Examples

Switch on the headset:

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

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

{% endtab %}

{% tab title="Response" %}

```javascript
{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "battery": 3,
    "connectionType": "bluetooth",
    "cq": {
      "AF3": 4,
      "AF4": 4,
      "Pz": 4,
      "T7": 4,
      "T8": 4
    },
    "cqStatus": "",
    "eegRate": 128,
    "fe": {
      "lowerFaceAction": "neutral",
      "lowerFacePower": 0,
      "upperFaceAction": "neutral",
      "upperFacePower": 0
    },
    "mc": {
      "action": "neutral",
      "power": 0
    },
    "motionRate": 64,
    "name": "Virtual Insight",
    "ownerId": "c7f6d941-d972-496b-8504-fcc903c46f02",
    "pm": {
      "engagement": {
        "isActive": true,
        "score": 0.5
      },
      "excitement": {
        "isActive": true,
        "score": 0.5
      },
      "focus": {
        "isActive": true,
        "score": 0.5
      },
      "interest": {
        "isActive": true,
        "score": 0.5
      },
      "relaxation": {
        "isActive": true,
        "score": 0.5
      },
      "stress": {
        "isActive": true,
        "score": 0.5
      }
    },
    "powerOn": true,
    "preRecordedSamples": "",
    "serial": "70E2002F",
    "type": "INSIGHT",
    "uuid": "70e2002f-e4d2-4708-a4d0-8600f2a04842"
  }
}
```

{% endtab %}
{% endtabs %}

Change the name, the CQ and the battery level of the headset:

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

```javascript
{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "updateVirtualHeadset",
  "params": {
    "cortexToken": "xxx",
    "virtualHeadsetId": "70e2002f-e4d2-4708-a4d0-8600f2a04842",
    "name": "My Virtual Insight",
    "battery": 1,
    "cq": {
      "AF3": 0,
      "AF4": 4,
      "Pz": 4,
      "T7": 0,
      "T8": 4
    }
  }
}

```

{% endtab %}

{% tab title="Response" %}

```javascript
{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "battery": 1,
    "connectionType": "bluetooth",
    "cq": {
      "AF3": 0,
      "AF4": 4,
      "Pz": 4,
      "T7": 0,
      "T8": 4
    },
    "cqStatus": "",
    "eegRate": 128,
    "fe": {
      "lowerFaceAction": "neutral",
      "lowerFacePower": 0,
      "upperFaceAction": "neutral",
      "upperFacePower": 0
    },
    "mc": {
      "action": "neutral",
      "power": 0
    },
    "motionRate": 64,
    "name": "My Virtual Insight",
    "ownerId": "c7f6d941-d972-496b-8504-fcc903c46f02",
    "pm": {
      "engagement": {
        "isActive": true,
        "score": 0.5
      },
      "excitement": {
        "isActive": true,
        "score": 0.5
      },
      "focus": {
        "isActive": true,
        "score": 0.5
      },
      "interest": {
        "isActive": true,
        "score": 0.5
      },
      "relaxation": {
        "isActive": true,
        "score": 0.5
      },
      "stress": {
        "isActive": true,
        "score": 0.5
      }
    },
    "powerOn": false,
    "preRecordedSamples": "",
    "serial": "70E2002F",
    "type": "INSIGHT",
    "uuid": "70e2002f-e4d2-4708-a4d0-8600f2a04842"
  }
}
```

{% endtab %}
{% endtabs %}
