---
title: "Link files"
method: POST
path: "/documents/v1/link"
tags: ["Documents"]
---

# Link files

`POST /documents/v1/link`

## Request

- Base URL: `https://api.mitti.com`
- URL: `https://api.mitti.com/documents/v1/link`
- Auth: HTTP bearer

Link files to other areas of the platform, such as an asset.

## Request body

- S12DocumentsV1LinkFilesRequest
  - `file_ids` string[]: The ids of the files to be linked To get the `file_id`, open the file in the SafetyCulture web app and copy the last part of the URL. For example, in this link `https://app.safetyculture.com/documents/document/765aa2e6-69cb-43b5-8ab4-48ab26e2a094`, the file ID is `765aa2e6-69cb-43b5-8ab4-48ab26e2a094`.
  - `entity_ids` string[], required: The ids of the entities that the file(s) are being linked to To get the `entity_id`, open the entity (e.g. asset) in the SafetyCulture web app and copy the last part of the URL. For example, in this link `https://app.safetyculture.com/assets/765aa2e6-69cb-43b5-8ab4-48ab26e2a094`, the entity ID is `765aa2e6-69cb-43b5-8ab4-48ab26e2a094`.
  - `domain` 'LINKED_FILE_DOMAIN_UNSPECIFIED' | 'LINKED_FILE_DOMAIN_ASSET', required

## Response `200`

A successful response.

- S12DocumentsV1LinkFilesResponse
  - `linked_files` S12DocumentsV1LinkFilesResponseLinkedFile[]: List of files that were linked.
    - `file_id` string: The ID of the file that was linked.
    - `entity_id` string: The ID of the entity that the file is linked to.
    - `link_id` string: The ID of the link that was created. Link ID is a unique identifier for the link used to retrieve the link details.

## Other responses

- `default`: An unexpected error response.

---

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