> For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://ibee.ai/docs/llms.txt (full text of every page: https://ibee.ai/docs/llms-full.txt). For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://ibee.ai/docs/_mcp/server.

# Cancel a queued GPU VM backup restore

POST https://api.ibee.ai/v1/compute/gpu-vm-backups/restores/{restore_id}/actions/cancel

Cancels a restore only while it is queued and has not started. A running restore is refused with 409. Repeating a successful cancellation returns the cancelled restore. Requires scope: vm.write.

```
# Example request with curl (set IBEE_API_TOKEN to a platform API token and WORKSPACE_ID to the workspace first).
# RESTORE_ID: Snapshot or backup restore operation ID
curl -X POST "https://api.ibee.ai/v1/compute/gpu-vm-backups/restores/$RESTORE_ID/actions/cancel?workspace_id=$WORKSPACE_ID" \
  -H "Authorization: Bearer $IBEE_API_TOKEN"
```


Reference: https://ibee.ai/docs/api-reference/gpu-vms/cancel-gpu-vm-backup-restore

## Authentication

- `Authorization` header (bearer token, required) — IBEE platform API token. Production tokens start with `ibee_prod_key_`; development tokens start with `ibee_dev_key_`. Use a token only with its matching gateway environment.

## Servers

- `https://api.ibee.ai/v1` (Production, default)
- `https://api.ibee.co.in/v1` (Development)

## Request

### Path parameters

- `restore_id` (string, required) — Snapshot or backup restore operation ID.

### Query parameters

- `workspace_id` (string, required) — The positive numeric workspace ID to scope this request to. Zero, negative, and non-numeric values are rejected.

## Response

### 200

Restore cancelled before execution.

- `organization_id` (string, required) — ID of the organization that owns the VM.
- `workspace_id` (string, required) — ID of the workspace the VM belongs to.
- `restore_id` (string, required) — Unique ID of the restore job.
- `source_vm_id` (string, required) — VM the recovery point was taken from.
- `target_mode` (enum, required) — - `replace`: restored onto the source VM. - `new_vm`: restored into a new VM. - `volume_only`: a single volume was restored.
  - Allowed values: `replace`, `new_vm`, `volume_only`
- `recovery_point_id` (string, required) — Recovery point that was restored.
- `status` (enum, required) — Lifecycle status of a backup run, snapshot set or restore. - `queued`: accepted and waiting to start. - `running`: in progress. - `succeeded`: finished; the recovery point is usable. - `failed`: stopped with an error (see `error_message`). - `cancelled`: stopped before it completed. - `deleting`: remote backup deletion is in progress; the run becomes unavailable after cleanup.
  - Allowed values: `queued`, `running`, `succeeded`, `failed`, `cancelled`, `deleting`
- `organization_name` (string, optional, nullable) — Display name of the owning organization, when the service has it.
- `workspace_name` (string, optional, nullable) — Display name of the workspace, when the service has it.
- `target_vm_id` (string, optional, nullable) — VM that received the restore: the source VM for `replace`, the new VM for `new_vm`.
- `target_vm_name` (string, optional, nullable) — Display name of the target VM.
- `recovery_point_type` (enum, optional) — - `backup`: the recovery point is a backup run. - `snapshot`: the recovery point is a snapshot set.
  - Allowed values: `backup`, `snapshot`
- `started_at` (datetime, optional, nullable) — When the restore started (ISO 8601); null while queued.
- `completed_at` (datetime, optional, nullable) — When the restore finished (ISO 8601); null until it does.
- `error_message` (string, optional, nullable) — Error detail when `status` is `failed`.
- `metadata` (map from string to any, optional) — Additional service-specific key-value data.

## Errors

### 401 Unauthorized Error

The API token is missing, malformed or unknown (`invalid_api_key`).

- `error` (string, optional, nullable) — Machine-readable code from the gateway's authorization step, for example `invalid_api_key`, `insufficient_scope`, `organization_restricted`, `organization_suspended`, `verification_required`, `product_not_enabled` or `billing_denied`. The response descriptions list the codes for each status.
- `message` (string, optional) — Human-readable explanation, present on portal adapter errors.
- `request_id` (string, optional) — Correlation ID, present on portal adapter errors and in X-Request-Id.
- `required_scope` (string, optional, nullable) — The scope the token lacks, with `insufficient_scope`.
- `billing_reason` (string, optional, nullable) — Billing's reason with `billing_denied`, passed through unchanged: for example `insufficient_balance`, `credit_limit_exceeded`, `initial_topup_required`, `resource_limit_reached` or `resource_usage_unavailable`.
- `billing_sku_code` (string, optional, nullable) — The SKU the billing admission checked, when there was one.
- `billing_evaluated_at` (string, optional, nullable) — When Billing made the decision, as Billing returned it.
- `admission_context_id` (string, optional, nullable) — Billing admission context for this request, derived from the token, workspace, route and `X-Idempotency-Key`, so a retry with the same key gets the same id.
- `detail` (ErrorDetail, optional) — Error detail from the product service.

### 403 Forbidden Error

The token may not make this call. Gateway codes: `insufficient_scope` (with `required_scope`), `key_revoked`, `key_disabled`, `key_inactive`, `key_expired`, `unknown_route`, `workspace_not_allowed`, `principal_inactive`, `principal_not_member` and `principal_permission_denied`. `product_not_enabled` when the product is not enabled for the organization (IBEE turns some products on per organization; ask support for access). On writes, also `organization_restricted` (an admin restricted the organization) and `verification_required` (the token's user has not completed identity verification). A product service may also refuse with `detail`.

- `error` (string, optional, nullable) — Machine-readable code from the gateway's authorization step, for example `invalid_api_key`, `insufficient_scope`, `organization_restricted`, `organization_suspended`, `verification_required`, `product_not_enabled` or `billing_denied`. The response descriptions list the codes for each status.
- `message` (string, optional) — Human-readable explanation, present on portal adapter errors.
- `request_id` (string, optional) — Correlation ID, present on portal adapter errors and in X-Request-Id.
- `required_scope` (string, optional, nullable) — The scope the token lacks, with `insufficient_scope`.
- `billing_reason` (string, optional, nullable) — Billing's reason with `billing_denied`, passed through unchanged: for example `insufficient_balance`, `credit_limit_exceeded`, `initial_topup_required`, `resource_limit_reached` or `resource_usage_unavailable`.
- `billing_sku_code` (string, optional, nullable) — The SKU the billing admission checked, when there was one.
- `billing_evaluated_at` (string, optional, nullable) — When Billing made the decision, as Billing returned it.
- `admission_context_id` (string, optional, nullable) — Billing admission context for this request, derived from the token, workspace, route and `X-Idempotency-Key`, so a retry with the same key gets the same id.
- `detail` (ErrorDetail, optional) — Error detail from the product service.

### 404 Not Found Error

The requested resource was not found. Paused or unknown public gateway routes can return an empty body; an empty 404 for a paused method does not prove that an existing resource has been deleted.

- `error` (string, optional, nullable) — Machine-readable code from the gateway's authorization step, for example `invalid_api_key`, `insufficient_scope`, `organization_restricted`, `organization_suspended`, `verification_required`, `product_not_enabled` or `billing_denied`. The response descriptions list the codes for each status.
- `message` (string, optional) — Human-readable explanation, present on portal adapter errors.
- `request_id` (string, optional) — Correlation ID, present on portal adapter errors and in X-Request-Id.
- `required_scope` (string, optional, nullable) — The scope the token lacks, with `insufficient_scope`.
- `billing_reason` (string, optional, nullable) — Billing's reason with `billing_denied`, passed through unchanged: for example `insufficient_balance`, `credit_limit_exceeded`, `initial_topup_required`, `resource_limit_reached` or `resource_usage_unavailable`.
- `billing_sku_code` (string, optional, nullable) — The SKU the billing admission checked, when there was one.
- `billing_evaluated_at` (string, optional, nullable) — When Billing made the decision, as Billing returned it.
- `admission_context_id` (string, optional, nullable) — Billing admission context for this request, derived from the token, workspace, route and `X-Idempotency-Key`, so a retry with the same key gets the same id.
- `detail` (ErrorDetail, optional) — Error detail from the product service.

### 409 Conflict Error

The request conflicts with the current resource state.

- `error` (string, optional, nullable) — Machine-readable code from the gateway's authorization step, for example `invalid_api_key`, `insufficient_scope`, `organization_restricted`, `organization_suspended`, `verification_required`, `product_not_enabled` or `billing_denied`. The response descriptions list the codes for each status.
- `message` (string, optional) — Human-readable explanation, present on portal adapter errors.
- `request_id` (string, optional) — Correlation ID, present on portal adapter errors and in X-Request-Id.
- `required_scope` (string, optional, nullable) — The scope the token lacks, with `insufficient_scope`.
- `billing_reason` (string, optional, nullable) — Billing's reason with `billing_denied`, passed through unchanged: for example `insufficient_balance`, `credit_limit_exceeded`, `initial_topup_required`, `resource_limit_reached` or `resource_usage_unavailable`.
- `billing_sku_code` (string, optional, nullable) — The SKU the billing admission checked, when there was one.
- `billing_evaluated_at` (string, optional, nullable) — When Billing made the decision, as Billing returned it.
- `admission_context_id` (string, optional, nullable) — Billing admission context for this request, derived from the token, workspace, route and `X-Idempotency-Key`, so a retry with the same key gets the same id.
- `detail` (ErrorDetail, optional) — Error detail from the product service.

### 422 Unprocessable Entity Error

The request failed validation. Detail can contain a list of validation errors.

- `error` (string, optional, nullable) — Machine-readable code from the gateway's authorization step, for example `invalid_api_key`, `insufficient_scope`, `organization_restricted`, `organization_suspended`, `verification_required`, `product_not_enabled` or `billing_denied`. The response descriptions list the codes for each status.
- `message` (string, optional) — Human-readable explanation, present on portal adapter errors.
- `request_id` (string, optional) — Correlation ID, present on portal adapter errors and in X-Request-Id.
- `required_scope` (string, optional, nullable) — The scope the token lacks, with `insufficient_scope`.
- `billing_reason` (string, optional, nullable) — Billing's reason with `billing_denied`, passed through unchanged: for example `insufficient_balance`, `credit_limit_exceeded`, `initial_topup_required`, `resource_limit_reached` or `resource_usage_unavailable`.
- `billing_sku_code` (string, optional, nullable) — The SKU the billing admission checked, when there was one.
- `billing_evaluated_at` (string, optional, nullable) — When Billing made the decision, as Billing returned it.
- `admission_context_id` (string, optional, nullable) — Billing admission context for this request, derived from the token, workspace, route and `X-Idempotency-Key`, so a retry with the same key gets the same id.
- `detail` (ErrorDetail, optional) — Error detail from the product service.

### 429 Too Many Requests Error

A concurrency limit was reached. Retry later. For console sessions, `detail.code` is `user_limit` or `workspace_limit` (active sessions per user or per workspace).

- `error` (string, optional, nullable) — Machine-readable code from the gateway's authorization step, for example `invalid_api_key`, `insufficient_scope`, `organization_restricted`, `organization_suspended`, `verification_required`, `product_not_enabled` or `billing_denied`. The response descriptions list the codes for each status.
- `message` (string, optional) — Human-readable explanation, present on portal adapter errors.
- `request_id` (string, optional) — Correlation ID, present on portal adapter errors and in X-Request-Id.
- `required_scope` (string, optional, nullable) — The scope the token lacks, with `insufficient_scope`.
- `billing_reason` (string, optional, nullable) — Billing's reason with `billing_denied`, passed through unchanged: for example `insufficient_balance`, `credit_limit_exceeded`, `initial_topup_required`, `resource_limit_reached` or `resource_usage_unavailable`.
- `billing_sku_code` (string, optional, nullable) — The SKU the billing admission checked, when there was one.
- `billing_evaluated_at` (string, optional, nullable) — When Billing made the decision, as Billing returned it.
- `admission_context_id` (string, optional, nullable) — Billing admission context for this request, derived from the token, workspace, route and `X-Idempotency-Key`, so a retry with the same key gets the same id.
- `detail` (ErrorDetail, optional) — Error detail from the product service.

### 500 Internal Server Error

The service could not complete the request. Use request_id when contacting support.

- `error` (string, optional, nullable) — Machine-readable code from the gateway's authorization step, for example `invalid_api_key`, `insufficient_scope`, `organization_restricted`, `organization_suspended`, `verification_required`, `product_not_enabled` or `billing_denied`. The response descriptions list the codes for each status.
- `message` (string, optional) — Human-readable explanation, present on portal adapter errors.
- `request_id` (string, optional) — Correlation ID, present on portal adapter errors and in X-Request-Id.
- `required_scope` (string, optional, nullable) — The scope the token lacks, with `insufficient_scope`.
- `billing_reason` (string, optional, nullable) — Billing's reason with `billing_denied`, passed through unchanged: for example `insufficient_balance`, `credit_limit_exceeded`, `initial_topup_required`, `resource_limit_reached` or `resource_usage_unavailable`.
- `billing_sku_code` (string, optional, nullable) — The SKU the billing admission checked, when there was one.
- `billing_evaluated_at` (string, optional, nullable) — When Billing made the decision, as Billing returned it.
- `admission_context_id` (string, optional, nullable) — Billing admission context for this request, derived from the token, workspace, route and `X-Idempotency-Key`, so a retry with the same key gets the same id.
- `detail` (ErrorDetail, optional) — Error detail from the product service.

### 503 Service Unavailable Error

A service the request depends on did not answer. Gateway codes: `workspace_verification_unavailable`, `principal_verification_unavailable`, `principal_authorization_unavailable` and `product_check_unavailable` (whether the organization has the product could not be checked; retry later); on billable creates also `billing_admission_timeout`, `billing_admission_unavailable`, `billing_admission_disabled`, `billing_admission_not_configured` and the catalog codes `compute_catalog_unavailable`, `compute_catalog_not_configured`, `product_catalog_timeout`, `product_catalog_unavailable`, `product_catalog_not_configured` and `unsupported_product_quote`. Otherwise the product service's `detail`.

- `error` (string, optional, nullable) — Machine-readable code from the gateway's authorization step, for example `invalid_api_key`, `insufficient_scope`, `organization_restricted`, `organization_suspended`, `verification_required`, `product_not_enabled` or `billing_denied`. The response descriptions list the codes for each status.
- `message` (string, optional) — Human-readable explanation, present on portal adapter errors.
- `request_id` (string, optional) — Correlation ID, present on portal adapter errors and in X-Request-Id.
- `required_scope` (string, optional, nullable) — The scope the token lacks, with `insufficient_scope`.
- `billing_reason` (string, optional, nullable) — Billing's reason with `billing_denied`, passed through unchanged: for example `insufficient_balance`, `credit_limit_exceeded`, `initial_topup_required`, `resource_limit_reached` or `resource_usage_unavailable`.
- `billing_sku_code` (string, optional, nullable) — The SKU the billing admission checked, when there was one.
- `billing_evaluated_at` (string, optional, nullable) — When Billing made the decision, as Billing returned it.
- `admission_context_id` (string, optional, nullable) — Billing admission context for this request, derived from the token, workspace, route and `X-Idempotency-Key`, so a retry with the same key gets the same id.
- `detail` (ErrorDetail, optional) — Error detail from the product service.

### 504 Gateway Timeout Error

The gateway or a dependency timed out. The response may be a portal error, a Cloudflare problem-details object, HTML or plain text. A timed-out create may still have succeeded; use the same idempotency key where supported.

- `error` (string, optional, nullable) — Machine-readable code from the gateway's authorization step, for example `invalid_api_key`, `insufficient_scope`, `organization_restricted`, `organization_suspended`, `verification_required`, `product_not_enabled` or `billing_denied`. The response descriptions list the codes for each status.
- `message` (string, optional) — Human-readable explanation, present on portal adapter errors.
- `request_id` (string, optional) — Correlation ID, present on portal adapter errors and in X-Request-Id.
- `required_scope` (string, optional, nullable) — The scope the token lacks, with `insufficient_scope`.
- `billing_reason` (string, optional, nullable) — Billing's reason with `billing_denied`, passed through unchanged: for example `insufficient_balance`, `credit_limit_exceeded`, `initial_topup_required`, `resource_limit_reached` or `resource_usage_unavailable`.
- `billing_sku_code` (string, optional, nullable) — The SKU the billing admission checked, when there was one.
- `billing_evaluated_at` (string, optional, nullable) — When Billing made the decision, as Billing returned it.
- `admission_context_id` (string, optional, nullable) — Billing admission context for this request, derived from the token, workspace, route and `X-Idempotency-Key`, so a retry with the same key gets the same id.
- `detail` (ErrorDetail, optional) — Error detail from the product service.

## Types

### ErrorDetail

Error detail from the product service.

- string
- map from string to any
- list of any

## Examples

**Response**

```json
{
  "organization_id": "<organization_id>",
  "workspace_id": "<workspace_id>",
  "restore_id": "<restore_id>",
  "source_vm_id": "<source_vm_id>",
  "target_mode": "replace",
  "recovery_point_id": "<recovery_point_id>",
  "status": "queued",
  "organization_name": "<organization_name>",
  "workspace_name": "<workspace_name>",
  "target_vm_id": "<target_vm_id>",
  "target_vm_name": "<target_vm_name>",
  "recovery_point_type": "backup",
  "started_at": "2026-10-25T12:00:00Z",
  "completed_at": "2026-10-25T12:00:00Z",
  "error_message": "<error_message>",
  "metadata": {}
}
```

**SDK Code**

```python
import requests

url = "https://api.ibee.ai/v1/compute/gpu-vm-backups/restores/restore_123/actions/cancel"

querystring = {"workspace_id":"710995"}

headers = {"Authorization": "Bearer <token>"}

response = requests.post(url, headers=headers, params=querystring)

print(response.json())
```

```javascript
const url = 'https://api.ibee.ai/v1/compute/gpu-vm-backups/restores/restore_123/actions/cancel?workspace_id=710995';
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.ibee.ai/v1/compute/gpu-vm-backups/restores/restore_123/actions/cancel?workspace_id=710995"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.ibee.ai/v1/compute/gpu-vm-backups/restores/restore_123/actions/cancel?workspace_id=710995")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.ibee.ai/v1/compute/gpu-vm-backups/restores/restore_123/actions/cancel?workspace_id=710995")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.ibee.ai/v1/compute/gpu-vm-backups/restores/restore_123/actions/cancel?workspace_id=710995', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.ibee.ai/v1/compute/gpu-vm-backups/restores/restore_123/actions/cancel?workspace_id=710995");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.ibee.ai/v1/compute/gpu-vm-backups/restores/restore_123/actions/cancel?workspace_id=710995")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```