> For the complete documentation index, see [llms.txt](https://emotiv.gitbook.io/cortex-library-for-mobile/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-library-for-mobile/jsonapi/freeuprecords.md).

# freeUpRecords

This method is to ask Cortex to delete some records, to free up some space on the local hard drive. The records are not delete from the Emotiv cloud.

## Parameters

| Name        | Type               | Required | Description                                                                                    |
| ----------- | ------------------ | -------- | ---------------------------------------------------------------------------------------------- |
| cortexToken | `string`           | yes      | A token returned by [authorize](https://emotiv.gitbook.io/cortex-api/authentication/authorize) |
| records     | `array of strings` | yes      | A list of record IDs.                                                                          |

## Result

The result is an object with these fields:

| Name    | Type               | Description                                            |
| ------- | ------------------ | ------------------------------------------------------ |
| failure | `array of objects` | List of the records that Cortex failed to free up.     |
| success | `array of objects` | List of the records that Cortex successfully freed up. |

The failure objects include these fields:

| Name     | Type     | Description                                         |
| -------- | -------- | --------------------------------------------------- |
| code     | `number` | The error code.                                     |
| message  | `string` | The error message.                                  |
| recordId | `string` | The id of the record that Cortex failed to free up. |

The success objects include these fields:

| Name     | Type     | Description                                             |
| -------- | -------- | ------------------------------------------------------- |
| recordId | `string` | The id of the record that Cortex successfully freed up. |

## Example

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

```javascript
{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "freeUpRecords",
  "params": {
    "cortexToken": "xxx",
    "records": ["foo", "e4b40b0d-99e0-4f43-98ad-8296b125e495"]
  }
}
```

{% endtab %}

{% tab title="Response" %}

```javascript
{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "failure": [{
      "code": -32113,
      "message": "Invalid Record ID.",
      "recordId": "foo"
    }],
    "success": [{
      "recordId": "e4b40b0d-99e0-4f43-98ad-8296b125e495"
    }]
  }
}
```

{% endtab %}
{% endtabs %}
