---
title: "Attach a new entity to a study"
method: POST
path: "/study/{id}/attach"
tags: ["study"]
---

# Attach a new entity to a study

`POST /study/{id}/attach`

Attach a new entity to 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
  - `study_attach` InlineResponse20023StudyAttach
    - `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 - Cannnot 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. 1045 - Could not attach entities to the study. It appears as if the entity does not exist.

## Changes

- **2019-02-22** `8e2f718635ef` — 1 info
  - endpoint added
- **2018-01-17** `2209d99ea36e` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/openml/apis/openml-api/changes/study/:id/attach/post.md)

---

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