# Record object

Some methods of the API return one or more record objects, for example [queryRecords](https://emotiv.gitbook.io/cortex-api/records/queryrecords).

## Description

A record object includes these fields:

| Name               | Type                    | Description                                                                                                                                                                                                                                                                                                                                                        |
| ------------------ | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| uuid               | `string`                | The id of this record.                                                                                                                                                                                                                                                                                                                                             |
| ownerId            | `string`                | The id of the user this record belongs to. It is a GUID, it is not the EmotivID of the user.                                                                                                                                                                                                                                                                       |
| applicationId      | `string`                | The id of the application that created this record.                                                                                                                                                                                                                                                                                                                |
| applicationVersion | `string`                | The version of the application that created this record.                                                                                                                                                                                                                                                                                                           |
| title              | `string`                | The title of this record.                                                                                                                                                                                                                                                                                                                                          |
| description        | `string`                | The description of this record.                                                                                                                                                                                                                                                                                                                                    |
| tags               | `array of strings`      | The tags associated to this record.                                                                                                                                                                                                                                                                                                                                |
| experimentId       | `number (integer)`      | The experiment id associated to this record.                                                                                                                                                                                                                                                                                                                       |
| startDatetime      | `string (ISO datetime)` | When this record was created.                                                                                                                                                                                                                                                                                                                                      |
| endDatetime        | `string (ISO datetime)` | When this record was stopped.                                                                                                                                                                                                                                                                                                                                      |
| licenseId          | `string`                | The id of the license used by this record.                                                                                                                                                                                                                                                                                                                         |
| licenseScope       | `array of strings`      | <p>List of the data streams the license has access to.</p><p>The scope "eeg" gives access to the raw EEG data.</p><p>The scope "pm" gives access to the 2 hertz performance metrics.</p>                                                                                                                                                                           |
| subject            | `object`                | <p>This object has a single field "subjectName".<br>It is the subject name used to create this record. You can use <a href="../subjects/querysubjects">querySubjects</a> to get more information about the subject. If the record was created without a subject name, then the field "subjectName" contains the EmotivID of the user.</p>                          |
| localOnly          | `boolean`               | <p>If <strong>true</strong> then this record will not be uploaded to the EMOTIV cloud.</p><p>If <strong>false</strong> then it will be uploaded.</p>                                                                                                                                                                                                               |
| headbandPosition   | `string`                | <p>If the headset is an EPOC X, then this field tells you the position of the headband of this headset during this record. Can be "back" or "top".<br>If the headset is not an EPOC X, then this field is null.<br>See <a href="../headset/updateheadsetcustominfo">updateHeadsetCustomInfo</a> for details.</p><p><em>This field was added in Cortex 2.4</em></p> |

Depending on how you get the record, it may contains an additional field for the markers:

| Name    | Type               | Description                                                                                                               |
| ------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------- |
| markers | `array of objects` | A list of [marker objects](https://emotiv.gitbook.io/cortex-api/markers/marker-object). The markers added to this record. |

#### syncStatus

Record object returned from getRecordInfos has an additional field `syncStatus`:

| Name       | Type     | Description                                                                                                  |
| ---------- | -------- | ------------------------------------------------------------------------------------------------------------ |
| syncStatus | `object` | contain information of sync status (`status` field) and/or uploading/downloading progress (`percent` field). |

Available values for `status`:

* "pending": the record is waiting for being downloaded.
* "downloading": the record's data is being downloaded. Check progress in `percent` field.
* "downloaded": the record's data is on both the Emotiv Cloud and the local machine.
* "notDownloaded": the record's data is on the Emotiv Cloud and not on the local machine.
* "failedEncryption", "failedDownload": sync status of the record if [requestToDownloadRecordData](https://emotiv.gitbook.io/cortex-api/records/requesttodownloadrecorddata) fails.
* "notUploaded": the record is not uploaded to the Emotiv Cloud yet.
* "uploading": the record is being uploaded to the Emotiv Cloud. Check progress in `percent` field.
* "uploaded": the record is on both the Emotiv Cloud and the local machine.
* "failedAccessFile", "failedDecryption", "failedUpload": sync status of the record whose uploading fails. Cortex will try uploading again.
* "neverUploaded": The record will never be uploaded to the Emotiv Cloud. The record is created with virtual headsets in this case.

For example:

* A record is created but waiting for being uploaded to the Emotiv Cloud:

```
{
    "status": "notUpload"
}
```

* A record is waiting for downloaded from the Emotiv Cloud:

```
{
    "status": "pending"
}
```

* A record is created and is uploading to the Emotiv Cloud:

```
{
    "status": "uploading",
    "percent": 30
}
```

## Examples

```javascript
{
    "applicationId": "com.jon.snow.winterfell-app",
    "applicationVersion": "1.0",
    "description": "",
    "startDatetime": "2019-06-06T15:57:28.596410+07:00",
    "endDatetime": "2019-06-06T15:57:58.472229+07:00",
    "experimentId": 0,
    "licenseId": "xxx",
    "licenseScope": [
        "pm",
        "eeg"
    ],
    "localOnly": false,
    "markers": [
        {
            "endDatetime": "2019-06-06T15:57:33.523627+07:00",
            "extras": {},
            "label": "test1",
            "port": "Cortex Example",
            "startDatetime": "2019-06-06T15:57:33.523627+07:00",
            "type": "instance",
            "uuid": "3e8d3a26-f4bf-486c-8ece-6efb8b739a51",
            "value": 41
        },
        {
            "endDatetime": "2019-06-06T15:57:49.530743+07:00",
            "extras": {},
            "label": "test2",
            "port": "Cortex Example",
            "startDatetime": "2019-06-06T15:57:41.529661+07:00",
            "type": "interval",
            "uuid": "26fccfd8-e487-4623-910a-1ba8591fcdcf",
            "value": 42
        }
    ],
    "ownerId": "76c3468a-d9c0-428d-81b4-bdac5d63860e",
    "subject": {
        "subjectName": "Hodor"
    },
    "tags": ["snow", "cold", "winter"],
    "title": "Cortex Examples C++",
    "uuid": "db01c15e-d916-4a7b-9f1d-16295fd1c643"
}
```
