NAV Navbar
Cortex API
  • Introduction
  • Concepts
  • Methods
  • Data types
  • Workflow
  • Errors
  • Introduction

    Welcome

    Welcome to the Cortex API documentation!

    Cortex is a new and versatile API for interacting with Emotiv products, including the Insight, Epoc and Epoc+. The Cortex API is built on JSON and WebSockets, making it easy to access from a variety of programming languages and platforms. You can use Cortex to create games and apps, record data for experiments and more.

    This documentation is split into multiple sections. This introductory section describes how to get set up with Cortex. Concepts provides an overview of the API and how to use it. The Methods and Data types sections provide a detailed reference with examples for each part of the API.

    If you prefer to start with fully-worked examples, you can also find pre-built starter projects for various languages in our Cortex example repository.

    Installing Cortex

    To install Cortex, get it from the Cortex download page.

    Installer include Cortex UI application and Cortex Service. Cortex Service will automatic start after you finish install.

    To check Cortex Service is running you try to open Cortex UI. If you can enter to Cortex UI, Cortex Service working well.

    Concepts

    This is a general overview of the concepts in the API.

    Protocol

    The Cortex protocol is made of 3 building blocks: WebSockets, JSON, and JSON-RPC. WebSockets provide a real-time connection to the underlying Cortex service, designed to be easy to use in both desktop and web-based applications. JSON is a widely supported format used by Cortex to send and receive data, and JSON-RPC is a standard way of using JSON to make requests and get back the results.

    If you’re not familiar with WebSockets or JSON, it may be helpful to read An Introduction to WebSockets and An Introduction to JSON before going any further.

    WebSockets

    The Cortex service listens on port 54321. Depending on the WebSocket client you’re using, this means you can connect to it using the url wss://emotivcortex.com:54321.

    JSON-RPC

    Request

    {
      "jsonrpc": "2.0",
      "method": "hello",
      "params": {
        "hello": "world"
      },
      "id": 1
    }
    

    Response (success)

    {
      "jsonrpc": "2.0",
      "result": "hello, world!",
      "id": 1
    }
    
    

    Response (error)

    {
      "jsonrpc": "2.0",
      "error": {
        "code": -9999,
        "message": "Don't know how to say hello"
      }
      "id": 1
    }
    

    JSON-RPC builds on top of JSON by adding a few standard keys to track requests. An example request and response are shown to the right. The jsonrpc key is always 2.0, indicating the protocol version. method indicates which of the API Methods you’re trying to call, and params contains the keys and values you want to use for that method. To find the parameters for a given method, you can look it up in the Method reference.

    You’ll get either a response with a result, or an error if the request was unsuccessful. id is a parameter used to track the association between requests and responses. If you send 1, you’ll get 1 back. If you send "hello", you’ll get "hello" back.
    Currently, the request in Cortex is synchronous. We are planning change to support asynchronous in next version.

    The exception to this is streams of data that you receive from the headset, which do not follow a request-response pattern and do not follow JSON-RPC. They are described below, under Subscriptions.

    Authorization

    By default, You can work with Cortex without client id/ secret. But if you want to access Raw EEG data and high-resolution performance metrics, you have to call the authorize method with a client ID and secret. These are specific to your application and used for security and to prevent abuse. You can request a client ID and secret on your “my account” page.

    User accounts and licensing

    There are different levels of Cortex access depending on the user’s license. Most features are available for free, however a subscription is required for professional and research features like Raw EEG data and high-resolution performance metrics. For more information, see the licensing page.

    If your application will use these features, you should provide the username and password of the appropriately licensed user when you call the authorize method.

    debit parameter is amount of the sessions which user request to work on the local machine. this control how much quota an application is allowed to use.

    Auth token

    After authorizing, you will be provided with an authorization token to use in subsequent requests. This token is valid for 48 hours from when it’s issued. You can receive a new token by calling authorize again, or calling generateNewToken using the previous token to refresh it. Details on how to do this are in the authorize method documentation.

    Sessions

    A session represents a continuous period of data collection from a headset, whether live or prerecorded. To get data from a headset, you start by creating a session, put it into the appropriate state, then subscribe to receive the results in real time. The data available from the headset is split into various streams, described later in Subscriptions.

    Session lifecycle

    Every session has a status parameter, indicating its current state. This status can be opened, activated, or closed. New sessions start opened or activated and automatically become closed when the headset is unplugged or turned off (after a 1 minute delay if using the USB dongle).

    When a session is opened, you only can subscribe to get: motion, mental command, facial expression, band power, device data, low-resolution performance metrics.

    When a session is activated, depend on the license. You can subscribe to get Raw EEG or high-resolution performance metrics or both.

    License Raw EEG Performance Metrics
    advanced Yes low-resolution
    prime Yes high-resolution

    When a session is closed, no subscriptions are allowed.

    Diagram:

    session_lifecycle

    Multiple sessions

    On one connection, you only can create one session with one headset. Ex: app A create session “abcd” with headset “INSIGHT-1234” . If app A want to create another session with this headset need to close session “abcd” first. But app B can create a session with headset “INSIGHT-1234”. So, headset “INSIGHT-1234” has 2 session link with it. But these session are on different apps.

    Saved sessions

    After the session is set to “active” successfully. The data will be saved and uploaded on the Emotiv’s server. The saved datas include Raw EEG data, Motion data, Performance Metrics data.

    Subscriptions

    To actually receive data from a session, you have to subscribe to it. This is done using the subscribe method. Along with the session you want to subscribe to, you have to specify which streams you are interested in. Each stream represents a different kind of data coming from the headset.

    Streams

    Each stream returns a series of events, with relevant data in columns depending on the type of event. You can find the columns for each event under Data types.

    Stream Description
    mot Motion data from the accelerometer/gyroscope
    eeg Raw EEG data (see note in User accounts and licensing)
    com Mental Command Event
    fac Facial Expression Event
    met Performance Metrics data
    dev Device data include battery level , signal strength, and signal quality all of channel headset
    pow Band Power data
    sys System event ( for set up training )

    Markers

    Markers are reference points in the data stream, used to match external events with data in the EEG.

    Markers format in EEG stream is a pair of 2 channels IEE_MARKER and IEE_MARKER_HARDWARE.

    IEE_MARKER : Actual value of the marker inserted. If no marker trigger was detected at the particular timing sample, a value of 0 is added into the file (except from Extender, see IEE_MARKER_HARDWARE). Otherwise the number associated with the marker trigger (positive number), or the byte value transmitted via the USB/COM port, will be inserted for that sample.

    IEE_MARKER_HARDWARE: The index of device that has been used to trigger this marker. The value depends on order of devices (USB, serial, keyboard) when you use to send the marker. The first device will get an index of 1, the second will get 2, and vice versa.

    Example:

    Event MARKER_HARDWARE MARKER
    1st marker from keyboard, with value 26 1 26
    No event 0 0
    2nd marker from USB, with value 8 2 8
    3rd marker from keyboard, with value 99 1 99
    4th marker from serial, with value 42 3 42
    No event 0 0
    5th marker from Extender 1 0
    6th marker from USB, with value 27 2 27
    7th marker from serial, with value 24 3 24

    Placing

    You can place a marker using the injectMarker method.

    Methods

    login

    You need to provide a username and password of user from the Emotiv Cloud, and the client id/secret for your application.

    Parameters

    Request

    Parameter Type Required Description
    username string Yes Emotiv ID
    password string Yes Emotiv Password
    client_id string Yes Client ID
    client_secret string Yes Client Secret

    Example: Emotiv user login

    Request

      {
        "jsonrpc": "2.0",
        "method": "login",
        "params": {
          "username": "...",
          "password": "...",
          "client_id": "...",
          "client_secret": "...",
        },
        "id": 1
      }
    

    Response

      {
        "jsonrpc": "2.0",
        "id":1,
        "result": "...."
      }
    

    getUserLogin

    Return all user logged in to Cortex.

    Example: get User Login

    Request

      {
        "jsonrpc": "2.0",
        "method": "getUserLogin",
        "id": 1
      }
    

    Response

      {
        "jsonrpc": "2.0",
        "id":1,
        "result": ["cortextes"]
      }
    

    logout

    You need to provide a username.

    Parameters

    Request

    Parameter Type Required Description
    username string Yes Emotiv ID

    Example: Emotiv user logout

    Request

      {
        "jsonrpc": "2.0",
        "method": "logout",
        "params": {
          "username": "...",
        },
        "id": 1
      }
    

    Response

      {
        "jsonrpc": "2.0",
        "id":1,
        "result": "...."
      }
    

    authorize

    Authenticates a user. You can authenticate as an anonymous user, but to get access to Raw EEG data or high-resolution performance metrics or both, you need to provide a username and password of user from the Emotiv Cloud, and the client id/secret for your application.

    Auth tokens are valid for 48 hours. If you want to use them after that you must call authorize again or refresh the token.

    For more information about authentication, client ids, auth tokens and the token lifecycle, see the Authorization section in Concepts.

    Parameters

    Request

    Parameter Type Required Description
    client_id string No Client ID
    client_secret string No Client Secret
    license string No License ID
    debit number No Number of session will use on local machine (if don’t set default debit = 0)

    Response

    Parameter Type Description
    _auth string (Auth Token) Token for use in subsequent calls

    Example: Anonymous authorize

    Request

      {
        "jsonrpc": "2.0",
        "method": "authorize",
        "params": {},
        "id": 1
      }
    

    Response

      {
        "jsonrpc": "2.0",
        "id":1,
        "result": {
          "_auth": "..."
        }
      }
    

    This is an authorize with no app information.

    Example: Full user

    If you don’t set a specific license, Cortex will use oldest license which is activated.

    Request

      {
        "jsonrpc": "2.0",
        "method": "authorize",
        "params": {
          "client_id": "...",
          "client_secret": "...",
          "license": "..."
          "debit": 10
        },
        "id": 1
      }
    

    Response

      {
        "jsonrpc": "2.0",
        "id":1,
        "result": {
          "_auth": "..."
        }
      }
    

    This is an authorize with a client id and secret, which you get when you sign up for an application. For more information, see the Authorization section in Concepts.

    Example: Token refresh

    Request

      {
        "jsonrpc": "2.0",
        "method": "generateNewToken",
        "params": {
          "token": "..."
        },
        "id": 1
      }
    

    Response

      {
        "jsonrpc": "2.0",
        "id": 1,
        "result": {
          "_auth": "..."
        }
      }
    

    This will return a new token for you to use.

    You can genareate new token at any time. Both old token and new token can use if it doesn’t expire .

    acceptLicense

    End User has to accept our license to use Cortex. If user doesn’t accept, they can not use Cortex anymore.

    Parameters

    Request

    Parameter Type Required Description
    _auth string (Auth Token) Yes Auth token

    Response

    Parameter Type Description
    _auth string (Auth Token) New Cortex token

    Example: Emotiv user accept the license

    Request

      {
        "jsonrpc": "2.0",
        "method": "acceptLicense",
        "params": {
          "_auth": "abcd"
        },
        "id": 1
      }
    

    Response

      {
        "jsonrpc": "2.0",
        "id":1,
        "result": {
          "_auth": "..."
        }
      }
    

    queryHeadsets

    Shows details of any headsets connected to the device via USB wireless dongle, USB cable, or Bluetooth. You can query by id, and specify wildcards for partial matching. You can call this method without an auth token.

    Parameters

    Request

    Parameter Type Required Description
    headsetId string No Headset ID/wildcard

    Response

    Parameter Type Description
    (entire reponse) array of objects (headset) All matching headset objects

    When you use a wildcard :

    Symbol Return heaset type
    INSIGHT-* All Insight headset
    EPOC-* All Epoc headset
    EPOCPLUS-* All Epoc Plus headset

    Example: Query all

    Request

      {
        "jsonrpc": "2.0",
        "method": "queryHeadsets",
        "params": {},
        "id": 1
      }
    

    Response

      {
        "jsonrpc": "2.0",
        "id": 1,
        "result": []
      }
    

    Example: Query by ID

    Request

      {
        "jsonrpc": "2.0",
        "method": "queryHeadsets",
        "params": {
          "id": "EPOCPLUS-3B9ADF08"
        },
        "id": 1
      }
    

    Response

      {
        "jsonrpc": "2.0",
        "id": 1,
        "result": []
      }
    

    This queries a headset with a specific ID.

    Example: Query by wildcard ID

    Request

      {
        "jsonrpc": "2.0",
        "method": "queryHeadsets",
        "params": {
          "id": "INSIGHT-*"
        },
        "id": 1
      }
    

    Response

      {
        "jsonrpc": "2.0",
        "id": 1,
        "result": []
      }
    

    controlBluetoothHeadset

    This request is only use for MacOS when you want to connect headset via bluetooth.

    When you call request query headset and get a headset with status = pending and dongle empty, that mean this is bluetooth headset available in range.

    {
    	"connectedBy":"unknown",
    	"dongle":"",
    	"firmware":"",
    	"id":"INSIGHT-DEADBEEF",
    	"label":"","sensors":[],
    	"settings":{
    		"eegRate":128,
    		"eegRes":0,
    		"memsRate":0,
    		"memsRes":0,
    		"mode":""
    	},
    	"status":"pending"
    }
    

    You need to call this request to connect with headset.

    Parameters

    Request

    Parameter Type Required Description
    command string Yes must be “connect” or “disconnect”
    headset string Yes headset ID

    Response

    Parameter Type Description
    (entire reponse) string  

    Example: Connect headset via bluetooth

    Request

    {
      "jsonrpc": "2.0",
      "method": "controlBluetoothHeadset",
      "params": {
        "command": "connect",
        "headset": "INSIGHT-DEADBEEF"
      },
      "id": 1
    }
    

    Response

    {
      "jsonrpc": "2.0",
      "id": 1,
      "result": "Connect headset INSIGHT-DEADBEEF success"
    }
    

    createSession

    Creates a new session. Sessions are used to manage live or pre-recorded streams of data from the headset. To use a session successfuly, it must be in the correct state.

    For more information about sessions and state management, see the Sessions section in Concepts.

    Request

    Parameter Type Required Description
    _auth string (Auth Token) Yes Auth token
    status string (session state) Yes Initial session status
    headset string No Headset ID link with session (if not set Cortex will link with first headset connected)
    project string No Project name for session
    title string No Title name for session
    subject string No use in the future
    experimentID number No specific experiment id for the application

    Response

    Parameter Type Description
    (entire reponse) object (Session) Newly created session object

    Example: Without headset ID

    Request

      {
        "jsonrpc": "2.0",
        "method": "createSession",
        "params": {
          "_auth": "...",
          "status": "open"
        },
        "id": 1
      }
    

    Response

      {
        "jsonrpc": "2.0",
        "id": 1,
        "result": {
          "client": "",
          "headset": "INSIGHT-59683C10",
          "id": "af349e3e-c72b-44c9-992c-5ee1905cfdaa",
          "license": "",
          "logs": null,
          "markers": [],
          "profile": "",
          "started": "2017-03-23T18:25:08Z",
          "status": "opened",
          "stopped": "",
          "streams": {},
          "subject": "",
          "tags": []
        }
      }
    

    This creates a new session in the “opened” state.

    Example: With headset ID and status

    Request

      {
        "jsonrpc": "2.0",
        "method": "createSession",
        "params": {
          "_auth": "...",
          "headset": "INSIGHT-59683C10",
          "status": "active"
        },
        "id": 1
      }
    

    Response

      {
        "jsonrpc": "2.0",
        "id": 1,
        "result": {
          "client": "",
          "headset": "INSIGHT-59683C10",
          "id": "af349e3e-c72b-44c9-992c-5ee1905cfdaa",
          "license": "",
          "logs": null,
          "markers": [],
          "profile": "",
          "started": "2017-03-23T18:25:08Z",
          "status": "activated",
          "stopped": "",
          "streams": {},
          "subject": "",
          "tags": []
        }
      }
    

    In this example, we choose an existing headset to start a session on, and immediately put it into the “active” state, meaning EEG data is being recorded and can be subscribed to.

    With extra parameters

    Request

      {
        "jsonrpc": "2.0",
        "method": "createSession",
        "params": {
          "_auth": "abcd",
          "status": "active",
          "project": "Test Cortex",
          "title": "test1",
          "subject": "cuong"
        },
        "id": 1
      }
    

    Response

    {
      "id": 1,
      "jsonrpc": "2.0",
      "result": {
        "appId": "",
        "headset": {
          "connectedBy": "dongle",
          "dongle": "6ff",
          "firmware": "610",
          "id": "EPOCPLUS-DEADBEEF",
          "label": "",
          "sensors": [],
          "settings": {
            "eegRate": 128,
            "eegRes": 16,
            "memsRate": 64,
            "memsRes": 16,
            "mode": "EPOCPLUS"
          },
          "status": "connected"
        },
        "id": "9ea68a11-253d-427e-8020-5bc5e4c99a69",
        "license": "1ca3fd1c-4ce8-4643-8aa0-28a3255019e8",
        "logs": {
          "recordInfos": []
        },
        "markers": [],
        "owner": "cortextest",
        "profile": "",
        "project": "Test Cortex",
        "recording": false,
        "started": "2017-06-01T15:23:33.130641+07:00",
        "status": "activated",
        "stopped": "",
        "streams": null,
        "subject": "cuong",
        "tags": [],
        "title": "test1"
      }
    }
    

    In this example we set a custom title, project, and subject.

    updateSession

    Updates an existing session. You can use this to start or stop recording from the EEG (by modifying its status) or change the metadata associated with that session.

    For more information about sessions and state management, see the Sessions section in Concepts.

    Request

    Parameter Type Required Description
    _auth string (Auth Token) Yes Auth token
    session string No session ID . If this param not set, Cortex will get first session in session list do not close
    status string (session state) Yes New session status
    recordingName string No  
    recordingNote string No  
    recordingSubject string No  
    tags array of strings No  

    Response

    Parameter Type Description
    (entire reponse) object (session) Session object with modifications

    status value can set in updateSession

    Value Description
    “active” Set active for session.
    “close” Close session
    “startRecord” Start a record on this session
    “stopRecord” Stop record on this session
    “addTags” Add tag for this session
    “removeTags” Remove tag for this session

    Example: Start a record

    Request

    {
      "jsonrpc": "2.0",
      "method": "updateSession",
      "params": {
        "_auth": "...",
        "status": "startRecord",
        "recordingName": "demo",
        "recordingNote": "test1",
        "recordingSubject": "sub 1"
      },
      "id": 1
    }
    

    Response

    {
      "id": 1,
      "jsonrpc": "2.0",
      "result": {
        "appId": "",
        "headset": {
          "connectedBy": "dongle",
          "dongle": "6ff",
          "firmware": "610",
          "id": "EPOCPLUS-DEADBEEF",
          "label": "",
          "sensors": [],
          "settings": {
            "eegRate": 128,
            "eegRes": 16,
            "memsRate": 64,
            "memsRes": 16,
            "mode": "EPOCPLUS"
          },
          "status": "connected"
        },
        "id": "9ea68a11-253d-427e-8020-5bc5e4c99a69",
        "license": "1ca3fd1c-4ce8-4643-8aa0-28a3255019e8",
        "logs": {
          "recordInfos": [
            {
              "name": "demo",
              "notes": "test1",
              "recordId": "c7030f18-4b0f-4a6d-b953-a2b16edd217e",
              "sampleMarkerAFF": [
                174
              ],
              "sampleMarkerEEG": [
                11140
              ],
              "startMarkerRecording": "2017-06-01T15:25:00.994326+07:00",
              "stopMarkerRecording": "",
              "subject": "sub 1"
            }
          ]
        },
        "markers": [
          {
            "code": 1,
            "enums": [
              "record-1"
            ],
            "events": [
              [
                "2017-06-01T15:25:00.976923+07:00",
                1
              ]
            ],
            "label": "demo",
            "port": "EmotivProRecording"
          }
        ],
        "owner": "cortextest",
        "profile": "",
        "project": "Test Cortex",
        "recording": true,
        "started": "2017-06-01T15:23:33.130641+07:00",
        "status": "activated",
        "stopped": "",
        "streams": null,
        "subject": "",
        "tags": [],
        "title": "test1"
      }
    }
    

    querySessions

    Shows details of all sessions on the local machine of current user. Sessions can be queried by any field of Session object.

    For more information about sessions, see the Sessions section in Concepts.

    Parameters

    Request

    Parameter Type Required Description
    _auth string (Auth Token) Yes Auth token
    query json Yes Query param

    Response

    Parameter Type Description
    (entire reponse) array of objects (Sessions) All matching session objects

    Example: Query all

    Request

    {
      "jsonrpc": "2.0",
      "method": "querySessions",
      "params": {
        "_auth": "abcd"
      },
      "id": 1
    }
    

    Response

    {
      "jsonrpc": "2.0",
      "id": 1,
      "result": [
        {
          "client": "",
          "headset": "INSIGHT-59683C10",
          "id": "09fc4d57-a447-45e7-9776-630533ceeaf2",
          "license": "7ca047af-0f33-430a-8391-a96eb379de47",
          "logs": null,
          "markers": [],
          "profile": "",
          "recording": null,
          "started": "2017-04-03T10:49:02Z",
          "status": "opened",
          "stopped": "",
          "streams": {},
          "subject": "",
          "tags": []
        },
        {
          "client": "",
          "headset": "INSIGHT-59683C10",
          "id": "e6b578ae-7f75-4b67-97d2-dd47cb00a5a8",
          "license": "7ca047af-0f33-430a-8391-a96eb379de47",
          "logs": null,
          "markers": [],
          "profile": "",
          "recording": null,
          "started": "2017-04-03T10:01:28Z",
          "status": "activated",
          "stopped": "",
          "streams": {},
          "subject": "",
          "tags": []
        }
    }
    

    This returns all session on the local machine of current user.

    Example: Query by status

    Request

    {
      "jsonrpc": "2.0",
      "method": "querySessions",
      "params": {
        "_auth": "abcd",
        "query": {
          "status": "opened"
        }
      },
      "id": 1
    }
    

    Response

    {
      "jsonrpc": "2.0",
      "id": 1,
      "result": [
        {
          "client": "",
          "headset": "INSIGHT-59683C10",
          "id": "09fc4d57-a447-45e7-9776-630533ceeaf2",
          "license": "7ca047af-0f33-430a-8391-a96eb379de47",
          "logs": null,
          "markers": [],
          "profile": "",
          "recording": null,
          "started": "2017-04-03T10:49:02Z",
          "status": "opened",
          "stopped": "",
          "streams": {},
          "subject": "",
          "tags": []
        }
      ]
    }
    

    updateNote

    If you created a recording on a session. You can edit note for that reocord even the session closed

    Request

    Parameter Type Required Description
    _auth string (Auth Token) Yes Auth token
    session string Yes session ID
    note string Yes New record note
    record string Yes Record ID get in the field logs of session object

    Response

    Parameter Type Description
    (entire reponse) object (session) Session object with modifications

    Example: Update new note for record “1234” in session “abcd”

    Request

    {
      "jsonrpc": "2.0",
      "method": "updateNote",
      "params": {
        "_auth": "...",
        "session": "abcd",
        "note": "new note"
        "record": "1234"
      },
      "id": 1
    }
    

    Response

    {
    	"id":1,
    	"jsonrpc":"2.0",
    	"result":{
    		...,
    		"id": "abcd",
    		"logs":{
    			"recordInfos":[
    				{
    					"name":"test10",
    					"notes":"new note",
    					"recordId":"1234",
    					"sampleMarkerAFF":[
    						38,
    						101
    					],
    					"sampleMarkerEEG":[
    						2465,
    						6465
    					],
    					"startMarkerRecording":"2017-08-03T10:23:15.080335+07:00",
    					"stopMarkerRecording":"2017-08-03T10:23:46.560229+07:00",
    					"subject":"10"
    				}
    			]
    		},
    		...
    	}
    }
    

    subscribe

    Subscribes to a stream of data from a headset. While subscribed, you will receive events asynchronously as data comes in.

    For more information about sessions, see the Sessions section in Concepts, and for a general overview of streams and subscriptions, see Subscriptions.

    Parameters

    Request

    Parameter Type Required Description
    _auth string (Auth Token) Yes Auth token
    streams array of strings (stream type) Yes Streams to subscribe to
    session string No session id to subscribe (If this param not set, Cortex will get first session in session list do not close)
    replay boolean No should set false

    Response

    Parameter Type Description
    array of streams info json array  

    Stream Info

    Parameter Type Description
    stream name string (stream type) Streams to subscribe to
    cols array of strings column name and the order
    sid string subscription id

    Example: subscribe motion data

    Request

    {
      "jsonrpc": "2.0",
      "method": "subscribe",
      "params": {
        "_auth": "myToken",
        "streams": [
          "mot"
        ]
      },
      "id": 1
    }
    

    Response

    {
      "id": 1,
      "jsonrpc": "2.0",
      "result": [
        {
          "mot": {
            "cols": [
              "IMD_COUNTER",
              "IMD_GYROX",
              "IMD_GYROY",
              "IMD_GYROZ",
              "IMD_ACCX",
              "IMD_ACCY",
              "IMD_ACCZ",
              "IMD_MAGX",
              "IMD_MAGY",
              "IMD_MAGZ"
            ]
          },
          "sid": "3aed5a1e-4bc9-4a9b-bad5-815c403cbc1c"
        }
      ]
    }
    

    unsubscribe

    Unsubscribe from a stream previously subscribed to.

    For more information about sessions, see the Sessions section in Concepts, and for a general overview of streams and subscriptions, see Subscriptions.

    Parameters

    Request

    Parameter Type Required Description
    _auth string (Auth Token) Yes Auth token
    streams array of strings (Stream name) Yes Streams to unsubscribe from
    session string No session id to subscribe (If this param not set, Cortex will get first session in session list do not close)
    replay boolean No should set false

    Response

    Parameter Type Description
    (entire reponse) string  

    Example: Unsubscribe from a live session

    Request

    {
      "jsonrpc": "2.0",
      "method": "unsubscribe",
      "params": {
        "_auth": "myToken",
        "streams": [
          "mot"
        ]
      },
      "id": 1
    }
    

    Response

    {
      "jsonrpc": "2.0",
      "id": 1,
      "result": [
        {
          "message": "Unsubscribe stream mot with session af349e3e-c72b-44c9-992c-5ee1905cfdaa success"
        }
      ]
    }
    

    injectMarker

    Injects a marker into the data stream for a headset. The marker will appear in eeg event of that session.

    For more information about sessions, see the Sessions section in Concepts, and for a general overview of streams and subscriptions, see Subscriptions.

    Parameters

    Request

    Parameter Type Required Description
    _auth string (Auth Token) Yes Auth token
    session string No session id to subscribe (If this param not set, Cortex will get first session in session list do not close)
    label string Yes label name of marker
    value json (number or string) No marker value
    stop json (number or string) No stop value (Only use for marker recording)
    port string No marker source (if not set default value = Software)
    time number Yes Epoch time Timestamp for marker event

    Response

    Parameter Type Description
    session object json updated Session object

    A marker is identified by label and port . If you send 2 marker events have same label and port. That mean you send same marker type in twice. Other cases, you send two different marker type. See the details in marker concept.

    When you send marker value is string, the marker value in eeg stream is index of this string in array enums. The index start from 1.

    Event marker value array enums IEE_MARKER IEE_MARKER_HARDWARE
    Send 1st marker type A “start” [“start”] 1 1
    Send 2nd marker type A “stop” [“start”,”stop”] 2 1
    Send 3rd marker type B “test” [“test”] 1 2

    Example: String markers

    Request

    {
      "jsonrpc": "2.0",
      "method": "injectMarker",
      "params": {
        "_auth": "..",
        "session": "session-1234",
        "label": "test1",
        "value": "record-1",
        "port": "USB",
        "time": 123456789
      },
      "id": 1
    }
    

    Response

    {
      "jsonrpc": "2.0",
      "id": 1
      "appId": "",
      "headset": {...},
      "id": "1234",
      "license": "1ca3fd1c-4ce8-4643-8aa0-28a3255019e8",
      "logs": null,
      "markers": [
        {
          "code": 1,
          "enums": [
            "record-1"
          ],
          "events": [
            [
              "2017-06-01T15:25:00.976923+07:00",
              1
            ],
          ],
          "label": "test1",
          "port": "USB"
        }
      ],
      ...
    }
    

    Example: Numeric markers

    Request

    {
      "jsonrpc": "2.0",
      "method": "injectMarker",
      "params": {
        "_auth": "...",
        "session": "abcd",
        "label": "test1",
        "value": 10,
        "port": "Serial port",
        "time": 123456789
      },
      "id": 1
    }
    

    Response

    {
      "jsonrpc": "2.0",
      "id": 1
      "appId": "",
      "headset": {...},
      "id": "abcd",
      "license": "1ca3fd1c-4ce8-4643-8aa0-28a3255019e8",
      "logs": null,
      "markers": [
        {
          "code": 1,
          "enums": [],
          "events": [
            [
              "2017-06-01T15:25:00.976923+07:00",
              10
            ]
          ],
          "label": "test1",
          "port": "Serial port"
        }
      ],
      ...
    }
    

    getDetectionInfo

    This request return all useful informations for set up training Mental Command and Facial Expression.

    Parameters

    Request

    Parameter Type Required Description
    detection string Yes must be “mentalCommand” or “facialExpression”

    Response

    Parameter Type Description
    actions array of strings list action can training
    controls array of strings list control can set
    events array of strings list event can receive from system event

    Example: Get detection info of Mental Command

    Request

    {
      "jsonrpc": "2.0",
      "method": "getDetectionInfo",
      "params": {
        "detection": "mentalCommand"
      },
      "id": 1
    }
    

    Response

    {
      "jsonrpc": "2.0",
      "id": 1,
      "result":
        {
        	"actions":[
        		"neutral",
        		"push",
        		"pull",
        		"lift",
        		"drop",
        		"left",
        		"right",
        		"rotateLeft",
        		"rotateRight",
        		"rotateClockwise",
        		"rotateCounterClockwise",
        		"rotateForwards",
        		"rotateReverse",
        		"disappear"
        	],
        	"controls":[
        		"start",
        		"accept",
        		"reject",
        		"erase",
        		"reset"
        	],
        	"events":[
        		"MC_NoEvent",
        		"MC_Started",
        		"MC_Succeeded",
        		"MC_Failed",
        		"MC_Completed",
        		"MC_DataErased",
        		"MC_Rejected",
        		"MC_Reset",
        		"MC_AutoSamplingNeutralCompleted",
        		"MC_SignatureUpdated"
        	]
        }
    
    }
    

    training

    Set up training for Mental Comand or Facial Expression

    Parameters

    Request

    Parameter Type Required Description
    _auth string (Auth Token) Yes Auth token
    detection string Yes The name of detection (“mentalCommand” or “facialExpression”)
    session string No session ID . If this param not set, Cortex will get first session in session list do not close
    action string Yes Action will train. Get from the field actions in response of request get detection info
    status string Yes control for action. Get from the field controls of request get detection info

    Response

    Parameter Type Description
    (entire reponse) string  

    Example: Set training “start” for action “neutral” of Mental Command

    Request

    {
      "jsonrpc": "2.0",
      "method": "training",
      "params": {
        "_auth": "abcd",
        "detection": "mentalCommand",
        "session": "1234",
        "action": "neutral",
        "status": "start"
      },
      "id": 1
    }
    

    Response

    {
      "jsonrpc": "2.0",
      "id": 1,
      "result": "Set up training successfully for action neutral with status start"
    }
    

    queryProfile

    Get all trainining profile of specific user on the local machine

    Parameters

    Request

    Parameter Type Required Description
    _auth string (Auth Token) Yes Auth token

    Response

    Parameter Type Description
    (entire reponse) array of strings All profiles of user

    Example: Query profile

    Request

      {
        "jsonrpc": "2.0",
        "method": "queryProfile",
        "params": {
          "_auth": "abcd"
        },
        "id": 1
      }
    

    Response

      {
        "jsonrpc": "2.0",
        "id": 1,
        "result": ["test1","test2","test3"]
      }
    

    setupProfile

    This method help you work with training profile. You can save training data to new profile, load profile, upload profile to Emotiv’s server ….

    Parameters

    Request

    Parameter Type Required Description
    _auth string (Auth Token) Yes Auth token
    headset string Yes headset ID
    profile string Yes profile name
    status string Yes See below

    The status is action Cortex will do on profile:

    Value Description
    “create” create new training profile
    “save” save current training data to profile
    “load” load training data from profile
    “upload” upload training profile to server
    “delete” remove training profile on the local machine

    Response

    Parameter Type Description
    (entire reponse) string  

    Example: create new profile

    Request

      {
        "jsonrpc": "2.0",
        "method": "setupProfile",
        "params": {
          "_auth": "abcd",
          "headset": "INSIGHT-DEADBEEF",
          "profile": "test",
          "status": "create"
        },
        "id": 1
      }
    

    Response

      {
        "jsonrpc": "2.0",
        "id": 1,
        "result": "create profile test successfully"
      }
    

    Data types

    Headset Object

    Example Headset object

    {
      "connectedBy": "dongle",
      "dongle": "6ff",
      "firmware": "925",
      "id": "INSIGHT-59683C10",
      "label": "",
      "sensors": [],
      "settings": {
        "eegRate": 128,
        "eegRes": 14,
        "memsRate": 128,
        "memsRes": 14,
        "mode": "EPOC"
      },
      "status": "connected"
    }
    

    The headset object is returned by queryHeadsets. It contains the following fields:

    Field Description
    connectedBy One of dongle, usb cable, bluetooth
    dongle Dongle version ( connect by bluetooth dongle=0)
    firmware Firmware version of headset
    id Unique identifier for this headset
    label Custom name for headset (use in the future)
    sensors array of the channels headset (Use in the future)
    status headset status
    settings See below

    The settings field contains the following subfields:

    Field Description
    eegRate Sample rate for EEG data (in Hz, 128 or 256)
    eegRes Resolution for EEG data (in bits, 14 or 16)
    memsRate Sample rate for movement data (in Hz, 0, 32, 64, 128)
    memsRes Resolution for movement data (in bits, 14 or 16)
    mode One of EPOC, EPOCPLUS

    Session Object

    {
      "appId": "",
      "headset": {
        "connectedBy": "dongle",
        "dongle": "6ff",
        "firmware": "610",
        "id": "EPOCPLUS-DEADBEEF",
        "label": "",
        "sensors": [],
        "settings": {
          "eegRate": 128,
          "eegRes": 16,
          "memsRate": 64,
          "memsRes": 16,
          "mode": "EPOCPLUS"
        },
        "status": "connected"
      },
      "id": "9ea68a11-253d-427e-8020-5bc5e4c99a69",
      "license": "1ca3fd1c-4ce8-4643-8aa0-28a3255019e8",
      "logs": {
        "recordInfos": [
          {
            "name": "demo",
            "notes": "test1",
            "recordId": "c7030f18-4b0f-4a6d-b953-a2b16edd217e",
            "sampleMarkerAFF": [
              174,
              239
            ],
            "sampleMarkerEEG": [
              11140,
              15324
            ],
            "startMarkerRecording": "2017-06-01T15:25:00.994326+07:00",
            "stopMarkerRecording": "2017-06-01T15:25:33.906495+07:00",
            "subject": "sub 2"
          }
        ]
      },
      "markers": [
        {
          "code": 1,
          "enums": [
            "record-1"
          ],
          "events": [
            [
              "2017-06-01T15:25:00.976923+07:00",
              1
            ],
            [
              "2017-06-01T15:25:33.878849+07:00",
              -1
            ]
          ],
          "label": "demo",
          "port": "EmotivProRecording"
        }
      ],
      "owner": "cortextest",
      "profile": "",
      "project": "Test Cortex",
      "recording": false,
      "started": "2017-06-01T15:23:33.130641+07:00",
      "status": "closed",
      "stopped": "2017-06-01T15:25:53.315695+07:00",
      "streams": null,
      "subject": "",
      "tags": [],
      "title": "test1"
    }
    

    The session object is returned by createSession, updateSession and querySessions. It can also be updated by updateSession. It contains the following fields:

    Field Description
    appId Unique ID for the application which you use to authorize
    headset See the Headset data type
    id Unique ID for the session
    license License ID link with this session
    logs Contain recording info
    markers Contain marker info ( set by call injectMarker )
    owner Username that created the session (owner= Basic if an anonymous user)
    profile  
    project User-specified project name
    recording Whether the session is currently recording
    started ISO 8601 Timestamp for recording start
    status Current status: opened, activated or closed. See Session lifecycle
    stopped ISO 8601 Timestamp for recording start
    streams  
    subject User-specified subject
    tags An arrary of User-specified tag
    title User-specified title

    Marker

    {
      "code": 1,
      "enums": [
        "record-1"
      ],
      "events": [
        [
          "2017-06-01T15:25:00.976923+07:00",
          1
        ],
        [
          "2017-06-01T15:25:33.878849+07:00",
          -1
        ]
      ],
      "label": "demo",
      "port": "EmotivProRecording"
    }
    
    Field Description
    code value of channel IEE_MARKER_HARDWARE in Markers
    enums array of string value when set value in injectMarker is string
    events array of marker event
    label label name of marker
    port marker source (‘usb’,’keyboard’,’serial port’…)

    Event

    {
      "mot": [...],
      "sid": "af349e3e-c72b-44c9-992c-5ee1905cfdaa",
      "time": 1283.58928052493
    }
    

    Events are generated in response to subscribe requests. Each event contains the following fields:

    Field Description
    (stream) Key depending on stream name, value will be an array of data (see below)
    sid ID of the session that generated this event
    time (optional) Time since Cortex start in seconds

    The order of value in array value get from response of the request subscribe.

    eeg event

    Depend on the headset eeg can have 5 channels eeg or 14 channels eeg (5 channels for Insight headset, 14 channels for EPOC and EPOC PLUS headset)

    eeg event of Insight headset

    {
      "eeg": [
        12.0,
        0.0,
        150.0,
        8203.0,
        8225.0,
        8183.0,
        6346.0,
        4439.0,
        0.0,
        0.0
      ],
      "sid": "af349e3e-c72b-44c9-992c-5ee1905cfdaa",
      "time": 1283.58928052493
    }
    
    Column Description  
    IED_COUNTER Counter that increments by 1 each event  
    IED_INTERPOLATED 1 if this is interpolated package, otherwise = 0  
    IED_RAW_CQ Signal quality raw value  
    IED_AF3 AF3 channel  
    IED_T7 T7 channel  
    IED_Pz Pz channel  
    IED_T8 T8 channel  
    IED_AF4 AF4 channel  
    IED_MARKER_HARDWARE marker hardware value See Markers
    IED_MARKER marker value See Markers

    mot event

    {
      "mot": [
        2.0,
        8203.0,
        8225.0,
        8183.0,
        6346.0,
        4439.0,
        8214.0,
        8066.0,
        8058.0,
        8292.0
      ],
      "sid": "af349e3e-c72b-44c9-992c-5ee1905cfdaa",
      "time": 1283.58928052493
    }
    

    The unit of motion data is angular velocity, degrees per second.

    Column Description
    IMD_COUNTER Counter that increments by 1 each event
    IMD_GYROX Gyroscope, X axis
    IMD_GYROY Gyroscope, Y axis
    IMD_GYROZ Gyroscope, Z axis
    IMD_ACCX Acceleration, X axis
    IMD_ACCY Acceleration, Y axis
    IMD_ACCZ Acceleration, Z axis
    IMD_MAGX Magnetometer, X axis
    IMD_MAGY Magnetometer, Y axis
    IMD_MAGZ Magnetometer, Z axis

    com event

    {
      "com":[
        "push",
        0.673717498779297
      ],
      "sid":"46d18597-7034-40ab-9d6e-d617a89a24ce",
      "time":245.356536865234
    }
    
    Column Description
    act Mental command current action
    pow Mental command current action power

    fac event

    {
      "fac":[
        "lookD",
        "surprise",
        0.0,
        "neutral",
        0.0446911528706551
      ],
      "sid":"9a62d98f-5ad0-4bf9-8fa1-9695e2c92f2f",
      "time":383.103973388672
    }
    
    Column Description
    eyeAct eye action
    uAct upper face action
    uPow upper face action power
    lAct lower face action
    lPow lower face action power

    met event

    {
      "met":[
        0.651354849338531,
        0.0,
        0.302940726280212,
        0.0,
        0.560504496097565,
        0.0,
        0.298657447099686
      ],
      "sid":"9a62d98f-5ad0-4bf9-8fa1-9695e2c92f2f",
      "time":195.577545166016
    }
    
    Column Description
    int interest value
    str stress value
    rel relaxation value
    exc excitement value
    eng engagement value
    lex long term excitement value
    foc focus value

    dev event

    {
      "dev":[
        4,
        2,
        [
          0.0,
          0.0,
          0.0,
          0.0,
          0.0
        ]
      ],
      "sid":"26cf6ed7-38fd-4125-9474-83c161d9498f",
      "time":11664.9873046875
    }
    

    Depend on the headset signal quality will have 5 elements or 14 elements

    Column Description
    Battery battery level of headset
    Signal signal strength
    IEE_CHAN_AF3 signal quality of channel AF3
    IEE_CHAN_T7 signal quality of channel T7
    IEE_CHAN_Pz singal quality of channel Pz
    IEE_CHAN_T8 signal quality of channel T8
    IEE_CHAN_AF4 signal quality of channel AF4

    pow event

    {
      "pow":[
        64.0,
        46.0,
        66.0,
        65.0,
        71.0,
        42.0,
        57.0,
        37.0,
        369.0,
        76.0,
        22.0,
        40.0,
        17.0,
        50.0,
        41.0,
        14.0,
        10.0,
        31.0,
        26.0,
        30.0,
        20.0,
        36.0,
        26.0,
        80.0,
        40.0
      ],
      "sid":"d8834c5f-ae19-4a3c-8ce0-a861c5e05daf"
    }
    
    Column Description
    IED_AF3/theta theta value of channel AF3
    IED_AF3/alpha alpha value of channel AF3
    IED_AF3/betaL low-beta value of channel AF3
    IED_AF3/betaH high-beta value of channel AF3
    IED_AF3/gamma gamma value of channel AF3
    IED_T7/theta theta value of channel T7
    IED_T7/alpha alpha value of channel T7
    IED_T7/betaL low-beta value of channel T7
    IED_T7/betaH high-beta value of channel T7
    IED_T7/gamma gamma value of channel Pz
    IED_Pz/theta theta value of channel Pz
    IED_Pz/alpha alpha value of channel Pz
    IED_Pz/betaL low-beta value of channel Pz
    IED_Pz/betaH high-beta value of channel Pz
    IED_Pz/gamma gamma value of channel Pz
    IED_T8/theta theta value of channel T8
    IED_T8/alpha alpha value of channel T8
    IED_T8/betaL low-beta value of channel T8
    IED_T8/betaH high-beta value of channel T8
    IED_T8/gamma gamma value of channel T8
    IED_AF4/theta theta value of channel AF4
    IED_AF4/alpha alpha value of channel AF4
    IED_AF4/betaL low-beta value of channel AF4
    IED_AF4/betaH high-beta value of channel AF4
    IED_AF4/gamma gamma value of channel AF4

    sys event

    {
      "sid":"46d18597-7034-40ab-9d6e-d617a89a24ce",
      "sys":[
        "Mental Command",
        "MC_Started"
      ]
    }
    
    Column Description
    event Detection name (Mental Command or Facial Expression)
    msg Training event of Mental Command or Facial Expression

    Workflow

    How to authorize with an emotiv id

    Step 1:

    Cortex only allow authorize when have a logged in user. To check have any user logged in and that user is the object which you want to work.

    You call get user login

    Request

      {
        "jsonrpc": "2.0",
        "method": "getUserLogin",
        "id": 1
      }
    

    Response

      {
        "jsonrpc": "2.0",
        "id":1,
        "result": ["cortextest"]
      }
    

    If return value is not user which you want. Go to step 2, otherwise ignore it.

    Step 2:

    Call method log out user cortextest and call log in user account which you want.

    Step 3:

    Call method authorize

    How to get data from Cortex

    Step 1:

    You need to make sure your headset connected with Cortex by the way call query headset

    Request

      {
        "jsonrpc": "2.0",
        "method": "queryHeadsets",
        "id": 1
      }
    

    Response

      {
        "jsonrpc": "2.0",
        "id":1,
        "result": [
          {
            "connectedBy":"usb cable",
            "dongle":"6ff",
            "firmware":"625",
            "id":"EPOCPLUS-3B9ADF08",
            "label":"",
            "sensors":[],
            "settings":{
              "eegRate":256,
              "eegRes":16,
              "memsRate":32,
              "memsRes":0,
              "mode":"EPOCPLUS"
            }
          }
        ]
      }
    

    Step 2:

    Call method create session with that headset.

    Step 3:

    Subscribe stream type which you want to get

    How to training with Cortex

    The workflow of training Mental Command and Facial Expression are same.

    In this case, we try to set up training Mental Command

    Step 1:

    Call method get detection info to know parameter request when setup training.

    Step 2:

    Create sesion with a headset.

    Request

      {
        "jsonrpc": "2.0", 
        "method": "createSession",
        "params": {
          "_auth":"abcd",
          "status":"open"
        },
        "id": 1
      }
    

    Response

      {
        "id":1,
        "jsonrpc":"2.0",
        "result":{
          "appId":"com.emotiv.emotivpro",
          "headset":{
            "connectedBy":"dongle",
            "dongle":"6ff",
            "firmware":"925",
            "id":"INSIGHT-5A685AE3",
            "label":"",
            "sensors":[],
            "settings":{
              "eegRate":128,
              "eegRes":14,
              "memsRate":128,
              "memsRes":14,
              "mode":"EPOC"
            },
            "status":"connected"
          },
          "id":"46d18597-7034-40ab-9d6e-d617a89a24ce",
          "license":"9791062b-3fc2-423a-ba34-d62a7a1fe1f0",
          "logs":{
            "recordInfos":[]
          },
          "markers":[],
          "owner":"cortextest1",
          "profile":"",
          "project":"",
          "recording":null,
          "started":"2017-10-11T09:42:30.159864+07:00",
          "status":"opened",
          "stopped":"",
          "streams":null,
          "subject":"",
          "tags":[],
          "title":""
        }
      }
    

    Step 3:

    Subscribe sys event on the session that you have created.

    Request

      {
        "jsonrpc": "2.0",
        "method": "subscribe", 
        "params": {
          "_auth":"abcd",
          "streams":[
            "sys"
          ]
        },
        "id": 1
      }
    

    Response

      {
        "id":1,
        "jsonrpc":"2.0",
        "result":[
          {
            "sid":"46d18597-7034-40ab-9d6e-d617a89a24ce",
            "sys":{
              "cols":[
                "event",
                "msg"
              ]
            }
          }
        ]
      }
    

    Step 4:

    Setup training neutral action

    Request

      {
        "jsonrpc": "2.0", 
        "method": "training", 
        "params": {
          "_auth":"abcd",
          "detection":"mentalCommand",
          "session":"46d18597-7034-40ab-9d6e-d617a89a24ce",
          "action":"neutral",
          "status":"start"
        }, 
        "id": 1
      }
    

    Response

      {
        "id":1,
        "jsonrpc":"2.0",
        "result":"Set up training successfully for action neutral with status start"
      }
    

    After get response, You should able to receive an event from sys stream:

    Receive event training stated

      {
        "sid":"46d18597-7034-40ab-9d6e-d617a89a24ce",
        "sys":[
          "Mental Command",
          "MC_Started"
        ]
      }
    

    Step 5:

    Wait in a few seconds you will get the event training succeeded or failed

    Receive event training succeeded

      {
        "sid":"46d18597-7034-40ab-9d6e-d617a89a24ce",
        "sys":[
          "Mental Command",
          "MC_Succeeded"
        ]
      }
    

    If you got event training failed, back to Step 4.

    Call method training with status accept.

    Request

      {
        "jsonrpc": "2.0", 
        "method": "training", 
        "params": {
          "_auth":"abcd",
          "detection":"mentalCommand",
          "session":"46d18597-7034-40ab-9d6e-d617a89a24ce",
          "action":"neutral",
          "status":"accept"
        }, 
        "id": 1
      }
    

    Response

      {
        "id":1,
        "jsonrpc":"2.0",
        "result":"Set up training successfully for action neutral with status accept"
      }
    

    After that you will see event training completed.

      {
        "sid":"46d18597-7034-40ab-9d6e-d617a89a24ce",
        "sys":[
          "Mental Command",
          "MC_Completed"
        ]
      }
    

    Finish training action neutral.

    Continue training “push” with steps same “neutral”.

    Step 6:

    Call method Subscribe stream com.

    You should able to get these events from Mental Comand

      {"com":["push",0.673717498779297],"sid":"46d18597-7034-40ab-9d6e-d617a89a24ce","time":245.356536865234}
      {"com":["push",0.729008078575134],"sid":"46d18597-7034-40ab-9d6e-d617a89a24ce","time":245.474868774414}
      {"com":["push",0.773234784603119],"sid":"46d18597-7034-40ab-9d6e-d617a89a24ce","time":245.601669311523}
      {"com":["push",0.814013302326202],"sid":"46d18597-7034-40ab-9d6e-d617a89a24ce","time":245.735366821289}
      {"com":["push",0.841019809246063],"sid":"46d18597-7034-40ab-9d6e-d617a89a24ce","time":245.861480712891}
      {"com":["push",0.757715404033661],"sid":"46d18597-7034-40ab-9d6e-d617a89a24ce","time":245.995071411133}
      {"com":["push",0.342431217432022],"sid":"46d18597-7034-40ab-9d6e-d617a89a24ce","time":246.097534179688}
      {"com":["neutral",0.0],"sid":"46d18597-7034-40ab-9d6e-d617a89a24ce","time":246.232025146484}
      {"com":["neutral",0.0],"sid":"46d18597-7034-40ab-9d6e-d617a89a24ce","time":246.373306274414}
    

    Errors

    The API uses the following error codes:

    Error Code Description
    -32700 Invalid JSON was received by the server.
    -32600 The JSON sent is not a valid Request object.
    -32601 The method does not exist / is not available.
    -32602 Invalid method parameter(s).
    -32603 Internal JSON-RPC error.
    -32001 Incorrect user name or password.
    -32002 Invalid license key.
    -32003 No Internet connection.
    -32004 No headset connected.
    -32005 There is an active session already with this headset.
    -32006 No valid license to activate a new session.
    -32007 Session does not exist.
    -32008 The session was closed.
    -32009 Current session has been updated.
    -32010 The headset of current session has been disconnected.
    -32011 The recording of current session has been stopped.
    -32012 The current session must be activated first.
    -32013 Invalid status.
    -32014 Invalid auth token.
    -32015 Auth token expired.
    -32016 Stream unavailable or already been subscribed.
    -32017 The recording of current session has been started.
    -32018 Missing required parameters.
    -32019 Session limit has been reached for current device.
    -32020 The headset has to be connected by USB cable.
    -32021 Invalid client ID or client secret key.
    -32022 You have exceeded the limit on the number of devices.
    -32023 Missing client ID.
    -32024 The license is expired.
    -32025 Request ‘debit’ is greater than ‘maxDebit’ on the license.
    -32026 Daily debit limit exceeded.
    -32027 Application does not have permission to use the license.
    -32028 Session soft limit exceeded.
    -32029 Session hard limit exceeded.
    -32030 Session data already existed.
    -32031 Invalid profile name.
    -32032 Logout before login with new account.
    -32033 You must be logged in before calling authorize.
    -32034 Token does not match with current user.
    -32035 Account does not match with current user.
    -32036 Error processing profile.
    -32037 Training for this action is not supported.
    -32038 Extender ID not found.
    -32039 Request timed out.
    -32040 Multiple sessions cannot be activated on the same headset.
    -32041 EULA has not been accepted by the user.