> For the complete documentation index, see [llms.txt](https://emotiv.gitbook.io/cortex-api/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-api/records/createrecord.md).

# createRecord

This method is to create a new record.

{% hint style="info" %}
You must create and activate a session before you call this method. See [createSession](/cortex-api/session/createsession.md) for details.
{% endhint %}

## Parameters

| Name         | Type               | Required | Description                                                                                                                                                                                                                                                                                     |
| ------------ | ------------------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| cortexToken  | `string`           | yes      | A token returned by [authorize](/cortex-api/authentication/authorize.md).                                                                                                                                                                                                                       |
| session      | `string`           | yes      | A session id returned by [createSession](/cortex-api/session/createsession.md).                                                                                                                                                                                                                 |
| title        | `string`           | yes      | The title of the record. Must be 200 characters or less.                                                                                                                                                                                                                                        |
| description  | `string`           | no       | The description of the record.                                                                                                                                                                                                                                                                  |
| subjectName  | `string`           | no       | The name of a subject created by [createSubject](/cortex-api/subjects/createsubject.md). The subject is the person wearing the headset during the record. If you omit this field, then Cortex assumes that the [current user](/cortex-api/authentication/getuserlogin.md) is using the headset. |
| tags         | `array of strings` | no       | <p>A list of tags you can associate to this record.<br>You can use <a href="/pages/-LfwQyZr3OvdMh_aETU6">queryRecords</a> to search the records by tags.</p>                                                                                                                                    |
| experimentId | `number (integer)` | no       | <p>An experiment id you can associate to this record. If you omit this parameter then the experimentId of the record will be zero.</p><p><em>This parameter was added in Cortex 2.2.1</em></p>                                                                                                  |

## Result

The result is an object containing two fields:

| Name      | Type     | Description                                                                                 |
| --------- | -------- | ------------------------------------------------------------------------------------------- |
| record    | `object` | A [record object](/cortex-api/records/record-object.md) that represents the created record. |
| sessionId | `string` | The id of the session this record is linked to.                                             |

## Examples

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

```javascript
{
    "id": 1,
    "jsonrpc": "2.0",
    "method": "createRecord",
    "params": {
        "cortexToken": "xxx",
        "session": "1067dc90-eb17-489b-9514-69cb79ac696c",
        "title": "Cortex Examples C++"
    }
}
```

{% endtab %}

{% tab title="Response" %}

```javascript
{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "record": {
            "uuid": "222eb845-bc44-4a01-bf28-07445a7c7e8a",
            "applicationId": "com.jon.snow.winterfell-app",
            "applicationVersion": "1.0",
            "description": "",
            "endDatetime": "",
            "experimentId": 0,
            "licenseId": "xxx",
            "licenseScope": ["pm","eeg"],
            "ownerId": "76c3468a-d9c0-428d-81b4-bdac5d63860e",
            "startDatetime": "2019-05-31T11:06:24.398560+07:00",
            "tags": [],
            "title": "Cortex Examples C++"
        },
        "sessionId": "1067dc90-eb17-489b-9514-69cb79ac696c"
    }
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://emotiv.gitbook.io/cortex-api/records/createrecord.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
