---
title: "Detach Instances"
method: PUT
path: "/ocean/gcp/k8s/cluster/{oceanClusterId}/detachInstances"
tags: ["Ocean GKE"]
---

# Detach Instances

`PUT /ocean/gcp/k8s/cluster/{oceanClusterId}/detachInstances`

## Request

- Base URL: `https://api.spotinst.io`
- URL: `https://api.spotinst.io/ocean/gcp/k8s/cluster/{oceanClusterId}/detachInstances`
- Auth: HTTP bearer

Detach instances from your Ocean cluster.

## Parameters

- `#/paths/~1azure~1costs/get/parameters/0` (unresolved $ref)
- `#/paths/~1ocean~1aws~1k8s~1cluster~1%7BoceanClusterId%7D/get/parameters/1` (unresolved $ref)

## Request body

- object
  - `instancesToDetach` string[], required: Array of instance identifiers to be detached.
  - `shouldTerminateInstances` boolean: Determines whether the detached instances should be terminated or not. (Default true)
  - `shouldDecrementTargetCapacity` boolean: Determines whether the Ocean cluster's target capacity should be decremented. (Default false)
  - `drainingTimeout` integer: (Applies only if shouldTerminateInstances is on) The draining timeout (in seconds) before terminating the instance.

## Other responses

- `400`: Bad Request

---

[API](https://skmtc.dev/spot/apis/spot-by-flexera-api.md) - [All operations](https://skmtc.dev/spot/apis/spot-by-flexera-api/llms.txt) - [OpenAPI document](https://skmtc.dev/spot/apis/spot-by-flexera-api/revisions/f7e206fa6474?raw)
