Here is a list of the error codes that the Cortex API can return. This list is not exhaustive (yet) and will be updated in the future.
The message you sent to Cortex is not a valid JSON object. This is a bug is your application.
The message you sent to Cortex is a valid JSON object but it doesn't contain the expected fields. This a bug is your application. Please check Connecting to the Cortex API
You sent a request with an invalid method name. This a bug is your application. Please check this documentation to see which methods are available.
You sent a request to call a valid method, but the parameters are wrong. It can be because:
You didn't provide a required parameter
You provided a parameters with an invalid name
The name of parameter is correct but the value is invalid
This is a bug in your application. Please check the documentation of the method.
An unexpected error happened in Cortex while processing your request. This is probably a bug in Cortex. If the problem persists, please contact the EMOTIV customer support.
An unexpected error happened in the EMOTIV cloud while processing your request. It can be a temporary failure of the EMOTIV servers, like when the servers are in maintenance. Or it can be a bug in Cortex. If the problem persists, please contact the EMOTIV customer support.
The EMOTIV cloud cannot find the license of the user. When you call the method authorize, please make sure that you provide a valid license ID, or no license parameter at all. If the problem persists, then the owner of the license must contact the EMOTIV customer support.
Cortex must connect to the EMOTIV cloud to process your request, but the connection failed. Please make sure that you computer has a working internet connection.
You sent a request to perform an action on a specific headset, but Cortex cannot find this headset. Some possible reasons for this error:
You provided an invalid headset ID in your request
The headset was disconnected (maybe it is out of range of your computer)
The headset was switched off
You called the method createSession for a specific headset, but your application already has a session for this headset. This is a bug in your application. You cannot create 2 sessions for the same headset at the same time. You must close the existing session before creating a new one.
You called createSession or updateSession with the parameter "status" set to "active", but your license doesn't authorize you to activate a session. You have a paid EMOTIV license to activate a session. If you already have such a license but the problem still persists, then contact the EMOTIV customer support. You should also read the prerequisite.
You included a session ID in the parameters of your request, but Cortex cannot find this session. It can be because you session ID is invalid or because the session is already closed.
Many methods can return this error: updateSession, subscribe, unsubscribe, createRecord, injectMarker, training, etc...
You called a method that requires an active session, but the current session is inactive. It can happen if you call createRecord on an inactive session.
You included a Cortex token in the parameters of your request, but this token is invalid. This is a bug in your application. When a method requires a Cortex token, please make sure that your token comes from the result of the method authorize.
Your Cortex token has expired. You must call the method authorize again to get a new token. The Cortex token is valid for 48 hours.
You called the methods subscribe or unsubscribe with an invalid stream. The stream can be invalid for one of these reasons:
The name of the stream is incorrect. Check Data Subscription for the list of the available streams.
The stream is not available for this headset. For example, the motion data of an EPOC X headset can be disable.
The stream is "eeg" but the license doesn't allow you to access this stream. You can check the license with getLicenseInfo
You called createRecord for a specific session, but your application already started a record for the same session. You cannot create 2 records for the same session at the same time.
You tried to activate a session (with createSession or updateSession) but the "localQuota" of the license is zero. You can check the "localQuota" by calling the method getLicenseInfo. Every time you activate a session, the local quota of the license is reduced by 1.
To solve this error, you must increase the local quota of the license. Call authorize with the parameter "debit". For example, you can call authorize with a "debit" of 10, and this will increase the local quota by 10. Then you will be able to create and activate 10 sessions on this computer.
You called updateHeadset but the headset is connected to the computer via Bluetooth or a USB dongle. Instead, the user should connect the headset with a USB cable.
Your request includes an invalid client ID or an invalid client secret.
The license was used on too many devices (eg computer, tablet, phone...) The license has a device limit. You can check it by calling the method getLicenseInfo. If you want to increase the limit or transfer the license from 1 device to another, then please contact the EMOTIV customer support.
The license of the user has expired. You can check the license with getLicenseInfo. After the license is renewed, your application must call authorize to get a new token.
You called authorize with a valid license ID but your application doesn't have the permission to use this license.
When the computer is offline, you can use the license for a limited period of time. The end of this period is the "hard limit" of the license. You can check it with getLicenseInfo. After the "hard limit" has been reached, Cortex must connect to the EMOTIV cloud to validate the license again. To solve this problem, the computer must have an internet connection and then you must call authorize.
You sent a request to perform an action on a specific training profile, but Cortex cannot find this profile.
Cortex cannot process your request because no user is logged in. You must ask the user to log in in EMOTIV Launcher.
Your request includes a Cortex token that was created for a specific user, but the current user is a different one. In that case, that must call authorize again and get a new token. You can check the current user with getUserLogin.
You called training for an action that cannot be trained.
You tried to load a training profile for a specific headset, but this profile is already loaded for another headset. You cannot load the same profile on 2 different headset at the same time.
You tried to unload a training profile from a headset, but no profile was loaded for this headset.
You tried to perform an operation (eg setupProfile, training...) on a training profile, but this profile was loaded by another application. An application can only access a profile that loaded by itself. You can call getCurrentProfile to check if your application loaded the profile of a headset or not.
The user didn't approved your application yet. The user must open EMOTIV Launcher and approve your application.
Cortex failed to communicate with the headset. Maybe the wireless connection between the headset and the computer was interrupted. Your application should try again. You can also call queryHeadsets to check the status of the headset.
The EMOTIV ID of the user is inactive. The user must contact the EMOTIV customer support. You can call getUserLogin or getUserInformation to check the current user.
The EMOTIV cloud refused the user credentials provided by Cortex. The user must logout and login again.
There is something wrong with the Cortex token. Your application must call authorize to get a new Cortex token.
Your license cannot work when you are offline. You must be connected to the internet at all time to use this license. You can call getLicenseInfo to check the current license.
You tried to activate a session that is already active. You can call querySessions to check the status of your sessions.
You are trying to access a record that doesn't exist, or the record exist but you don't have the permission to access it.
You are trying to inject a marker or to stop a record but no record is is progress.
You are trying to inject a marker but its time is too far in the past. You should inject your markers in real time, at the moment the event you want to mark happens.
You are trying to inject a marker but its time is too far in the future. You should inject your markers in real time, at the moment the event you want to mark happens.
You called updateMarker with an invalid marker id.
You are trying to create or rename a training profile, but another profile with the same name already exists.
You are trying to update a marker that was already updated before.
The local Cortex database is corrupted. Please contact the EMOTIV customer support.
You are trying to update or delete a subject that doesn't exist. Or you are trying to create a record with an invalid subject.
You are trying to create a subject, but another subject with the same name already exists.
You are trying to load a training profile for a headset, but a profile was already loaded for this headset before. You must unload the current profile before loading a new one.
You are trying to create or update a record, but the record title is invalid. The title must be 200 characters long or less.
You are trying to export a record but Cortex cannot open the output CSV or EDF file.
You are trying to export a record but one of the data streams you requested is not available.