> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.cadrooms.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.cadrooms.com/_mcp/server.

# Link or ignore a file

PUT https://api.cadrooms.workers.dev/v1/revisions/{revisionId}/dependencies/{dependencyId}
Content-Type: application/json

Links a component of a file to another file in CAD ROOMS, or ignores the component. A component represents a dependency of the file.

This operation corresponds to the **Link File**, **Relink File**, and **Ignore File** actions in the File Relationships panel of the CAD ROOMS app.

Specify either `path` or `status`:

- `path`: Links the component to the latest state of the specified file and sets its status to `resolved`. The target file can belong to another project that you have access to.
- `status`: Specify `ignored` to set the component's status to `ignored` and remove any existing link to a file.

CAD ROOMS starts CAD processing once the file has no remaining missing references.

Required permission: Collaborator or higher in the project of the revision.


Reference: https://docs.cadrooms.com/api-reference/file-relationship/update-dependency

## Authentication

- `Authorization` header (bearer token, required) — An API key associated with your user account and workspace. API requests inherit your existing workspace permissions.
- `Authorization` header (bearer token, required) — The session token of a user signed in to the CAD ROOMS app. Every endpoint accepts it in place of an API key.

## Request

### Path parameters

- `revisionId` (string, required) — Unique identifier of the revision.
- `dependencyId` (string, required) — Unique identifier of the component. Use the `id` of a dependency.

### Body (application/json)

This endpoint expects an object.

- `path` (string, optional) — Path of the file to link to.
- `projectId` (string, optional) — Project of the file to link to. Defaults to the project of the revision.
- `status` (enum, optional) — Send `ignored` to ignore the component.
  - Allowed values: `ignored`

## Response

### 200

Returns the updated component.

- `id` (string, required) — Unique identifier for the link between the two files.
- `referencedName` (string, required) — Filename referenced by the parent file.
- `status` (enum, required) — Indicates whether the referenced file has been resolved. - `resolved`: The referenced file was found in the project. The `file` field contains its details. - `missing`: The referenced file could not be found in the project. - `ignored`: The reference has been marked as ignored.
  - Allowed values: `resolved`, `missing`, `ignored`
- `file` (FileReference, required, nullable) — Details of the referenced file when `status` is `resolved`. Returns `null` otherwise.

## Errors

### 400 Bad Request Error

The request contains invalid or missing parameters. See `details` for specific validation errors.

- `error` (ErrorError, required)

### 401 Unauthorized Error

The API key is missing, invalid, expired, or revoked.

- `error` (ErrorError, required)

### 404 Not Found Error

The requested resource does not exist or is not accessible to your account. Both cases return the same response.

- `error` (ErrorError, required)

### 429 Too Many Requests Error

The rate limit has been exceeded. Wait for the duration specified in the `Retry-After` header before retrying.

- `error` (ErrorError, required)

### 500 Internal Server Error

An unexpected server error occurred. Retry later. Include the `requestId` when contacting support.

- `error` (ErrorError, required)

## Types

### FileReference

Contains basic information about a referenced file.

- `path` (string, required) — Full file path, including its folder and filename, separated by `/`.
- `name` (string, required) — Filename, including its extension.
- `revisionId` (string, required, nullable) — ID of the file's revision.

### ErrorError

- `code` (string, required) — Stable error identifier for programmatic error handling. Every endpoint can return the general codes listed on the Errors page. Where a business condition applies, an endpoint returns a more specific code, documented on that endpoint.
- `message` (string, required) — Human-readable error description. May change over time.
- `requestId` (string, required) — Unique request identifier used for troubleshooting. The same value is returned in the `Request-Id` header of every response. Include this when contacting support.
- `details` (list of ErrorErrorDetailsItems, optional) — Optional. Contains field-level validation errors for `400` responses.

### ErrorErrorDetailsItems

- `field` (string, required) — Name of the request field that failed validation.
- `message` (string, required) — Description of the validation issue.

## Examples

**Request**

```json
{
  "path": "hardware/bolt_m8.prt"
}
```

**Response**

```json
{
  "id": "5c2e3944-fdc1-4e2d-ae9d-e58024c4b469",
  "referencedName": "bolt_m8.prt",
  "status": "resolved",
  "file": {
    "path": "hardware/bolt_m8.prt",
    "name": "bolt_m8.prt",
    "revisionId": "8ce73f1c-c7c2-4449-a22d-74457f9422ed"
  }
}
```

**SDK Code**

```python File Relationship_updateDependency_example
import requests

url = "https://api.cadrooms.workers.dev/v1/revisions/a7e9d949-ebc6-4707-a493-a3f13f2a1b51/dependencies/5c2e3944-fdc1-4e2d-ae9d-e58024c4b469"

payload = { "path": "hardware/bolt_m8.prt" }
headers = {
    "Authorization": "Bearer <API key>",
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.json())
```

```javascript File Relationship_updateDependency_example
const url = 'https://api.cadrooms.workers.dev/v1/revisions/a7e9d949-ebc6-4707-a493-a3f13f2a1b51/dependencies/5c2e3944-fdc1-4e2d-ae9d-e58024c4b469';
const options = {
  method: 'PUT',
  headers: {Authorization: 'Bearer <API key>', 'Content-Type': 'application/json'},
  body: '{"path":"hardware/bolt_m8.prt"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go File Relationship_updateDependency_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.cadrooms.workers.dev/v1/revisions/a7e9d949-ebc6-4707-a493-a3f13f2a1b51/dependencies/5c2e3944-fdc1-4e2d-ae9d-e58024c4b469"

	payload := strings.NewReader("{\n  \"path\": \"hardware/bolt_m8.prt\"\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("Authorization", "Bearer <API key>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby File Relationship_updateDependency_example
require 'uri'
require 'net/http'

url = URI("https://api.cadrooms.workers.dev/v1/revisions/a7e9d949-ebc6-4707-a493-a3f13f2a1b51/dependencies/5c2e3944-fdc1-4e2d-ae9d-e58024c4b469")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <API key>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"path\": \"hardware/bolt_m8.prt\"\n}"

response = http.request(request)
puts response.read_body
```

```java File Relationship_updateDependency_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://api.cadrooms.workers.dev/v1/revisions/a7e9d949-ebc6-4707-a493-a3f13f2a1b51/dependencies/5c2e3944-fdc1-4e2d-ae9d-e58024c4b469")
  .header("Authorization", "Bearer <API key>")
  .header("Content-Type", "application/json")
  .body("{\n  \"path\": \"hardware/bolt_m8.prt\"\n}")
  .asString();
```

```php File Relationship_updateDependency_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.cadrooms.workers.dev/v1/revisions/a7e9d949-ebc6-4707-a493-a3f13f2a1b51/dependencies/5c2e3944-fdc1-4e2d-ae9d-e58024c4b469', [
  'body' => '{
  "path": "hardware/bolt_m8.prt"
}',
  'headers' => [
    'Authorization' => 'Bearer <API key>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp File Relationship_updateDependency_example
using RestSharp;

var client = new RestClient("https://api.cadrooms.workers.dev/v1/revisions/a7e9d949-ebc6-4707-a493-a3f13f2a1b51/dependencies/5c2e3944-fdc1-4e2d-ae9d-e58024c4b469");
var request = new RestRequest(Method.PUT);
request.AddHeader("Authorization", "Bearer <API key>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"path\": \"hardware/bolt_m8.prt\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift File Relationship_updateDependency_example
import Foundation

let headers = [
  "Authorization": "Bearer <API key>",
  "Content-Type": "application/json"
]
let parameters = ["path": "hardware/bolt_m8.prt"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.cadrooms.workers.dev/v1/revisions/a7e9d949-ebc6-4707-a493-a3f13f2a1b51/dependencies/5c2e3944-fdc1-4e2d-ae9d-e58024c4b469")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```