# stopRecord

This method is to stop a record that was previously started by [createRecord](https://emotiv.gitbook.io/cortex-api/records/createrecord). This will set the end date time of the record to the current date time.

## Parameters

| Name        | Type     | Required | Description                                                                                                            |
| ----------- | -------- | -------- | ---------------------------------------------------------------------------------------------------------------------- |
| cortexToken | `string` | yes      | A token returned by [authorize](https://emotiv.gitbook.io/cortex-api/authentication/authorize).                        |
| session     | `string` | yes      | The session id you provided when you called [createRecord](https://emotiv.gitbook.io/cortex-api/records/createrecord). |

A record is linked to a session. So to close a record, you need to provide the session id.

## Result

The result is an object containing these fields:

| Name      | Type     | Description                                                                    |
| --------- | -------- | ------------------------------------------------------------------------------ |
| record    | `object` | A [record object](https://emotiv.gitbook.io/cortex-api/records/record-object). |
| sessionId | `string` | The session id linked to the record.                                           |

## Example

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

```javascript
{
    "id": 1,
    "jsonrpc": "2.0",
    "method": "stopRecord",
    "params": {
        "cortexToken": "xxx",
        "session": "38fef6d7-979b-420b-aa25-dd60ef5edc02"
    }
}
```

{% endtab %}

{% tab title="Response" %}

```javascript
{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "record": {
            "applicationId": "com.jon.snow.winterfell-app",
            "applicationVersion": "1.0",
            "description": "",
            "endDatetime": "2019-06-06T11:42:23.436191+07:00",
            "experimentId": 0,
            "licenseId": "xxx",
            "licenseScope": ["pm","eeg"],
            "ownerId": "76c3468a-d9c0-428d-81b4-bdac5d63860e",
            "startDatetime": "2019-06-06T11:41:53.088632+07:00",
            "tags": [],
            "title": "Cortex Examples C++",
            "uuid": "d8fe7658-71f1-4cd6-bb5d-f6775b03438f"
        },
        "sessionId": "38fef6d7-979b-420b-aa25-dd60ef5edc02"
    }
}
```

{% endtab %}
{% endtabs %}
