> 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.

# Add files to an ECO

POST https://api.cadrooms.workers.dev/v1/ecos/{ecoId}/files
Content-Type: application/json

Adds files to an ECO. The request fails if any of the specified files are already included in this ECO or another draft or open ECO in the project.

While the ECO is in draft or open status, any contribution that changes one of these files updates the revision displayed for that file in the ECO.

Required permission: Collaborator or higher in the project.

Plan requirement: Business plan.


Reference: https://docs.cadrooms.com/api-reference/ecos/add-eco-files

## 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

- `ecoId` (string, required) — Unique identifier of the ECO.

### Body (application/json)

This endpoint expects an object.

- `paths` (list of string, required) — Paths of the files to add.

## Response

### 201

Returns the files that were added.

- `data` (list of EcoFile, required) — The files that were added.

## 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)

### 403 Forbidden Error

The workspace plan does not support the requested feature.

- `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

### EcoFile

Represents a file included in an ECO, with its current revision.

- `path` (string, required) — Full file path, including its folder and filename, separated by `/`.
- `name` (string, required) — Filename, including its extension.
- `revisionMajor` (string, required, nullable) — Letter part of the file's current revision. Returns `null` if the file has no current revision.
- `revisionMinor` (integer, required, nullable) — Number part of the file's current revision. Returns `null` if the file has no current revision.
- `revisionId` (string, required, nullable) — ID of the file's current revision, which is its newest revision that is not obsolete. Returns `null` if the file has no current 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
{
  "paths": [
    "parts/bracket.prt"
  ]
}
```

**Response**

```json
{
  "data": [
    {
      "path": "parts/bracket.prt",
      "name": "bracket.prt",
      "revisionMajor": null,
      "revisionMinor": null,
      "revisionId": null
    }
  ]
}
```

**SDK Code**

```python ECOs_addEcoFiles_example
import requests

url = "https://api.cadrooms.workers.dev/v1/ecos/a3cfa1ac-c576-47d4-a4bd-d304b1ba21b2/files"

payload = { "paths": ["parts/bracket.prt"] }
headers = {
    "Authorization": "Bearer <API key>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript ECOs_addEcoFiles_example
const url = 'https://api.cadrooms.workers.dev/v1/ecos/a3cfa1ac-c576-47d4-a4bd-d304b1ba21b2/files';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <API key>', 'Content-Type': 'application/json'},
  body: '{"paths":["parts/bracket.prt"]}'
};

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

```go ECOs_addEcoFiles_example
package main

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

func main() {

	url := "https://api.cadrooms.workers.dev/v1/ecos/a3cfa1ac-c576-47d4-a4bd-d304b1ba21b2/files"

	payload := strings.NewReader("{\n  \"paths\": [\n    \"parts/bracket.prt\"\n  ]\n}")

	req, _ := http.NewRequest("POST", 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 ECOs_addEcoFiles_example
require 'uri'
require 'net/http'

url = URI("https://api.cadrooms.workers.dev/v1/ecos/a3cfa1ac-c576-47d4-a4bd-d304b1ba21b2/files")

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

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

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

```java ECOs_addEcoFiles_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.cadrooms.workers.dev/v1/ecos/a3cfa1ac-c576-47d4-a4bd-d304b1ba21b2/files")
  .header("Authorization", "Bearer <API key>")
  .header("Content-Type", "application/json")
  .body("{\n  \"paths\": [\n    \"parts/bracket.prt\"\n  ]\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.cadrooms.workers.dev/v1/ecos/a3cfa1ac-c576-47d4-a4bd-d304b1ba21b2/files', [
  'body' => '{
  "paths": [
    "parts/bracket.prt"
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <API key>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp ECOs_addEcoFiles_example
using RestSharp;

var client = new RestClient("https://api.cadrooms.workers.dev/v1/ecos/a3cfa1ac-c576-47d4-a4bd-d304b1ba21b2/files");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <API key>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"paths\": [\n    \"parts/bracket.prt\"\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift ECOs_addEcoFiles_example
import Foundation

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

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.cadrooms.workers.dev/v1/ecos/a3cfa1ac-c576-47d4-a4bd-d304b1ba21b2/files")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
```