---
title: "Detach Instances"
method: PUT
path: "/ocean/aws/ecs/cluster/{oceanClusterId}/detachInstances"
tags: ["Ocean ECS"]
---

# Detach Instances

`PUT /ocean/aws/ecs/cluster/{oceanClusterId}/detachInstances`

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 EC2 instances should be terminated or not.
  - `shouldDecrementTargetCapacity` boolean — Determines whether the Ocean cluster's target capacity should be decremented.

## Other responses

- `400` — Bad Request

---

[API](https://skmtc.net/spot/apis/spot-by-flexera-api.md) · [All operations](https://skmtc.net/spot/apis/spot-by-flexera-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/spot/spot-by-flexera-api/revisions/72813baf8d47/schema)
