# sessionKeys.cancelOperation

> Documentation index: [llms.txt](https://namera.ai/llms.txt).

Source: https://namera.ai/docs/sdk/reference/session-keys/cancel-operation

Cancel an unsigned installation or removal preparation.

`namera.sessionKeys.cancelOperation()` cancel an unsigned installation or removal preparation.



## Usage [#usage]

Install `@namera-ai/sdk` and set `NAMERA_API_KEY` on your backend. IDs and responses below are illustrative fixtures; replace IDs with your own resources.

<Tabs items={["index.ts", "client.ts"]}>
<Tab value="index.ts">

```ts title="index.ts"
import { namera } from "./client";
const result = await namera.sessionKeys.cancelOperation("0199dfe1-0000-7000-8000-000000000014");
if (!result.success) throw new Error(result.error.message);

console.log(result.data);
```

</Tab>
<Tab value="client.ts">

```ts title="client.ts"
import { NameraClient } from "@namera-ai/sdk";

export const namera = new NameraClient({
  apiKey: process.env.NAMERA_API_KEY!,
});
```

</Tab>
</Tabs>

## Returns [#returns]

API methods return a `Promise<NameraResult<T, E>>`. When `success` is `true`,
`data` contains the value described below and `error` is `null`. On failure,
`data` is `null` and `error` describes the failure.

The JSON example shows the complete successful `data`, with illustrative values.
Date-time values use ISO strings in JSON; bigint values use decimal strings.
See [Handling Results and Errors](https://namera.ai/docs/sdk/handling-results-and-errors) for the error shape.

Returns `operationId` and `status: "cancelled"`.

<div className="docs-response">

```json
{
  "operationId": "0199dfe1-0000-7000-8000-000000000014",
  "status": "cancelled"
}
```

</div>

## Parameters [#parameters]

### operationId [#operationid]

Type: `string`. Required. Resource UUID returned by creation, preparation, or recovery; not an address or transaction hash.

```ts title="index.ts"
import { namera } from "./client";
const result = await namera.sessionKeys.cancelOperation("0199dfe1-0000-7000-8000-000000000014"); // [!code focus]
if (!result.success) throw new Error(result.error.message);

console.log(result.data);
```

## Behavior and errors [#behavior-and-errors]

Requires the operation’s install/uninstall permission and the initiating actor. Signed or submitted work cannot be cancelled; it must reconcile. Cancellation changes no session grants or onchain permissions.
