> 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/requesttodownloadrecorddata.md).

# requestToDownloadRecordData

This method is to ask Cortex to download the EEG/motion/CQ/detections data of a record from the EMOTIV cloud.

## Use case

Suppose that the user has installed Cortex on 2 computers, named computer A and computer B. On computer A, the user creates a record, and Cortex uploads this record to the EMOTIV cloud.

Then, on computer B, Cortex automatically downloads the metadata of this record, ie its name, description, start time, end time, etc... So this record is visible when you call methods like [queryRecord](/cortex-api/records/queryrecords.md)  or [getRecordInfos](/cortex-api/records/getrecordinfos.md).

But Cortex doesn't automatically download the actual data of the record, ie the EEG, motion, CQ, the results of the detections, etc... So you cannot [export](/cortex-api/records/exportrecord.md) this record. To download the actual data, you must call the method "requestToDownloadRecordData".

## Parameters

| Name        | Type               | Required | Description                                                               |
| ----------- | ------------------ | -------- | ------------------------------------------------------------------------- |
| cortexToken | `string`           | yes      | A token returned by [authorize](/cortex-api/authentication/authorize.md). |
| recordIds   | `array of strings` | yes      | A list of record ids.                                                     |

## Result

The result is an object with 2 fields:

| Name    | Type               | Description                                             |
| ------- | ------------------ | ------------------------------------------------------- |
| success | `array of objects` | List of the records that Cortex will start to download. |
| failure | `array of objects` | List of the records that Cortex will not download.      |

Each object in the success array include these fields:

| Name     | Type     | Description                                                                                                      |
| -------- | -------- | ---------------------------------------------------------------------------------------------------------------- |
| recordId | `string` | <p>The id of a record that was added to the Cortex download queue.</p><p>Cortex will now start the download.</p> |

Each object in the failure array include these fields:

| Name     | Type     | Description                                     |
| -------- | -------- | ----------------------------------------------- |
| recordId | `string` | The id of a record that Cortex cannot download. |
| code     | `number` | The error code for this record.                 |
| message  | `string` | The error message for this record.              |

## Example

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

```json
{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "requestToDownloadRecordData",
  "params": {
    "cortexToken": "xxx",
    "recordIds": [
        "33a9aa44-5a90-4881-8613-78493752b86d", 
        "3a4b7eb0-3b6c-4e16-a480-cbda8181f092"
      ]
  }
}
```

{% endtab %}

{% tab title="Response" %}

```json
{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "failure": [{
      "code": -32186,
      "message": "The record already exists.",
      "recordId": "33a9aa44-5a90-4881-8613-78493752b86d"
    }],
    "success": [{
      "recordId": "3a4b7eb0-3b6c-4e16-a480-cbda8181f092"
    }]
  }
}
```

{% 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/requesttodownloadrecorddata.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.
