---
title: "Detach an entity from a study"
method: POST
path: "/study/{id}/detach"
tags: ["study"]
---

# Detach an entity from a study

`POST /study/{id}/detach`

Detach an entity from an exising study. Upon success, it returns the study id, type, and linked entities.

## Path parameters

- `id` number, required

## Query parameters

- `api_key` string, required

## Response `200`

Properties of the updated study

- object
  - `upload_study` InlineResponse20026StudyAttach
    - `id` string — ID of the study, a positive integer
    - `main_entity_type` string — Main entity type of the of the study
    - `linked_entities` string — The number of linked entities

## Other responses

- `412` — Precondition failed. An error code and message are returned. 1041 - Could not find study. Check the study ID in your request. 1042 - Cannot attach entities to legacy studies. 1043 - Please provide POST field 'ids'. 1044 - Please ensure that the 'ids' in the POST field is a list of natural numbers. 1046 - Could not detach entities from the study. It appears as if the entity does not exist.

---

[API](https://skmtc.net/openml/apis/openml-api.md) · [All operations](https://skmtc.net/openml/apis/openml-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/openml/openml-api/revisions/263d3d6ee586/schema)
