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

# deleteRecord

This method is to delete one or more records.

The records will be deleted from the local computer, but also from the EMOTIV account of the user in the cloud, and from any computer where the user is logged in.

Your application cannot delete a record that was created by another application.

{% hint style="danger" %}
Deleting a record is **irreversible**. There is **no way** to recover a deleted record.
{% endhint %}

## Parameters

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

## Result

The result is an object that includes these fields:

| Name    | Type               | Description                                                                                          |
| ------- | ------------------ | ---------------------------------------------------------------------------------------------------- |
| success | `array of objects` | For each record you successfully deleted, this array contains an object that includes the record id. |
| failure | `array of objects` | For each record that couldn't be deleted, this array contains an object that describes the error.    |

In case of success, you get an object with these fields:

| Name     | Type     | Description                                         |
| -------- | -------- | --------------------------------------------------- |
| recordId | `string` | The id of the record that was successfully deleted. |

In case of failure, you get an object with these fields:

| Name     | Type     | Description                                    |
| -------- | -------- | ---------------------------------------------- |
| recordId | `string` | The id of the record that couldn't be deleted. |
| code     | `number` | The error code.                                |
| message  | `string` | The error message.                             |

## Examples

Deleting two records, including one that has an invalid id.

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

```javascript
{
    "id": 1,
    "jsonrpc": "2.0",
    "method": "deleteRecord",
    "params": {
        "cortexToken": "xxx",
        "records": [
            "d8fe7658-71f1-4cd6-bb5d-f6775b03438f",
            "invalid-id"
        ]
    }
}
```

{% endtab %}

{% tab title="Response" %}

```javascript
{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "success": [
            {"recordId":"d8fe7658-71f1-4cd6-bb5d-f6775b03438f"}
        ],
        "failure": [
            {"recordId":"invalid-id","code":1234,"message":"..."}
        ]
    }
}
```

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