> ## Documentation Index
> Fetch the complete documentation index at: https://docs.supernote.com/llms.txt
> Use this file to discover all available pages before exploring further.

# cancelRecognize

> Cancel the ongoing recognition task initiated by [recognizeElements](/en/api-reference/supernote-plugin/plugin-comm-api/recognize-elements).

```ts theme={null}
static cancelRecognize(): Promise<APIResponse<boolean>>;
```

**Returns**

* [`APIResponse<boolean>`](/en/api-reference/supernote-plugin/types/api-response): `result === true` means canceled successfully

## Example

```ts wrap theme={null}
import { PluginCommAPI } from 'sn-plugin-lib';

export async function exampleCancelRecognize() {
  const res = await PluginCommAPI.cancelRecognize();
  if (!res.success) {
    throw new Error(res.error?.message ?? 'cancelRecognize call failed');
  }
  return res.result;
}
```
