---
title: "Link an attachment to an attachment element"
method: PUT
path: "/api/v1/attachments/{id}"
tags: ["Attachments"]
---

# Link an attachment to an attachment element

`PUT /api/v1/attachments/{id}`

This endpoint links an existing attachment with a specified attachment element by their IDs.

**Important Note:**

An attachment can only be linked with an attachment element on the same page (such as an experiment, protocol, report, or document) where it was initially uploaded.

Before linking the attachment, ensure that the target section and attachment element are already in place; if not, create them beforehand.

To do this, use the "Add a section" and "Add element" requests. For further instructions, refer to our article on [Uploading Files to Experiments via API](https://help.labguru.com/en/articles/9636468-uploading-files-to-experiments-via-api) .

## Path parameters

- `id` integer, required

## Request body

- UpdateAttachment
  - `token` string, required
  - `item` object
    - `element_id` integer, required — The ID of the attachment element to which the attachment will be linked

## Response `200`

OK

## Other responses

- `404` — Not Found

---

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