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

# Create changes

POST https://api.cadrooms.workers.dev/v1/projects/{projectId}/changes
Content-Type: application/json

Adds changes to your list of changes. Each change has a `type`. If any individual change fails, the entire request fails.

Supported change types:

- `deleted`: Marks the file at `path` for deletion. CAD ROOMS removes the file from the project when you contribute the changes.
- `renamed`: Moves the file from `path` to `newPath`. You must hold the check-out for the file. If the file is new in your changes or is already marked as deleted, CAD ROOMS removes the old path from your changes. Otherwise, CAD ROOMS adds the old path to your changes with a `deleted` status. CAD ROOMS then adds the new path to your changes with the same file content. If the new path already exists in your changes, CAD ROOMS replaces its content while preserving its existing status, even if that status is `deleted`.

When renaming a file, CAD ROOMS checks out the new path to you if it does not exist in any contribution. If the new path exists in a contribution, you must already hold its check-out.

The request fails if another user holds a check-out on either the file or the new path. If Unique Filenames is enabled for the workspace, the request also fails if another file in the workspace has the same name.

Required permission: Collaborator or higher in the project.


Reference: https://docs.cadrooms.com/api-reference/files/create-changes

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

- `projectId` (string, required) — Unique identifier of the project.

### Body (application/json)

This endpoint expects an object.

- `changes` (list of ProjectsProjectIdChangesPostRequestBodyContentApplicationJsonSchemaChangesItems, required) — The changes to add.

## Response

### 201

Returns the changes that were added. A rename adds two changes: the old path as deleted and the new path as added.

- `data` (list of Change, required) — The changes 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)

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

### ProjectsProjectIdChangesPostRequestBodyContentApplicationJsonSchemaChangesItems

- `type` (enum, required) — What the change does to the file.
  - Allowed values: `deleted`, `renamed`
- `path` (string, required) — Path of the file.
- `newPath` (string, optional) — New path of the file. Required for `renamed`.

### Change

Represents one of your changes.

- `id` (string, required) — Unique identifier for the change.
- `path` (string, required) — Path of the file in the project.
- `status` (enum, required) — What the change does to the file.
  - Allowed values: `added`, `modified`, `deleted`
- `createdAt` (datetime, required) — Time at which the change was added.
- `size` (integer, optional) — Size of the file in bytes.
- `sha256` (string, optional) — SHA-256 hash of the file content.

### 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
{
  "changes": [
    {
      "type": "deleted",
      "path": "parts/old-bracket.prt"
    },
    {
      "type": "renamed",
      "path": "parts/bracket.prt",
      "newPath": "parts/housing-bracket.prt"
    }
  ]
}
```

**Response**

```json
{
  "data": [
    {
      "id": "a47c2e90-58d1-4b36-8f0a-c13e6d7b2954",
      "path": "parts/old-bracket.prt",
      "status": "deleted",
      "createdAt": "2026-10-07T14:03:11Z"
    },
    {
      "id": "c81e4b27-9f30-4d65-a2b8-7e1d0c5f3a96",
      "path": "parts/bracket.prt",
      "status": "deleted",
      "createdAt": "2026-10-07T14:03:11Z"
    },
    {
      "id": "3d6f9a12-b7c4-4e08-91d5-2a8c6e0b4f73",
      "path": "parts/housing-bracket.prt",
      "status": "added",
      "createdAt": "2026-10-07T14:03:11Z",
      "size": 482113,
      "sha256": "9f2c1b7e4a6d8c0f3e5b2a917d4c6e8f1a3b5c7d9e0f1a2b3c4d5e6f7a8b9c0d"
    }
  ]
}
```

**SDK Code**

```python Files_createChanges_example
import requests

url = "https://api.cadrooms.workers.dev/v1/projects/6c83044f-ec8a-4a01-8a6b-e8b3eb988d2b/changes"

payload = { "changes": [
        {
            "type": "deleted",
            "path": "parts/old-bracket.prt"
        },
        {
            "type": "renamed",
            "path": "parts/bracket.prt",
            "newPath": "parts/housing-bracket.prt"
        }
    ] }
headers = {
    "Authorization": "Bearer <API key>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Files_createChanges_example
const url = 'https://api.cadrooms.workers.dev/v1/projects/6c83044f-ec8a-4a01-8a6b-e8b3eb988d2b/changes';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <API key>', 'Content-Type': 'application/json'},
  body: '{"changes":[{"type":"deleted","path":"parts/old-bracket.prt"},{"type":"renamed","path":"parts/bracket.prt","newPath":"parts/housing-bracket.prt"}]}'
};

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

```go Files_createChanges_example
package main

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

func main() {

	url := "https://api.cadrooms.workers.dev/v1/projects/6c83044f-ec8a-4a01-8a6b-e8b3eb988d2b/changes"

	payload := strings.NewReader("{\n  \"changes\": [\n    {\n      \"type\": \"deleted\",\n      \"path\": \"parts/old-bracket.prt\"\n    },\n    {\n      \"type\": \"renamed\",\n      \"path\": \"parts/bracket.prt\",\n      \"newPath\": \"parts/housing-bracket.prt\"\n    }\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 Files_createChanges_example
require 'uri'
require 'net/http'

url = URI("https://api.cadrooms.workers.dev/v1/projects/6c83044f-ec8a-4a01-8a6b-e8b3eb988d2b/changes")

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  \"changes\": [\n    {\n      \"type\": \"deleted\",\n      \"path\": \"parts/old-bracket.prt\"\n    },\n    {\n      \"type\": \"renamed\",\n      \"path\": \"parts/bracket.prt\",\n      \"newPath\": \"parts/housing-bracket.prt\"\n    }\n  ]\n}"

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

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

HttpResponse<String> response = Unirest.post("https://api.cadrooms.workers.dev/v1/projects/6c83044f-ec8a-4a01-8a6b-e8b3eb988d2b/changes")
  .header("Authorization", "Bearer <API key>")
  .header("Content-Type", "application/json")
  .body("{\n  \"changes\": [\n    {\n      \"type\": \"deleted\",\n      \"path\": \"parts/old-bracket.prt\"\n    },\n    {\n      \"type\": \"renamed\",\n      \"path\": \"parts/bracket.prt\",\n      \"newPath\": \"parts/housing-bracket.prt\"\n    }\n  ]\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.cadrooms.workers.dev/v1/projects/6c83044f-ec8a-4a01-8a6b-e8b3eb988d2b/changes', [
  'body' => '{
  "changes": [
    {
      "type": "deleted",
      "path": "parts/old-bracket.prt"
    },
    {
      "type": "renamed",
      "path": "parts/bracket.prt",
      "newPath": "parts/housing-bracket.prt"
    }
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <API key>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Files_createChanges_example
using RestSharp;

var client = new RestClient("https://api.cadrooms.workers.dev/v1/projects/6c83044f-ec8a-4a01-8a6b-e8b3eb988d2b/changes");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <API key>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"changes\": [\n    {\n      \"type\": \"deleted\",\n      \"path\": \"parts/old-bracket.prt\"\n    },\n    {\n      \"type\": \"renamed\",\n      \"path\": \"parts/bracket.prt\",\n      \"newPath\": \"parts/housing-bracket.prt\"\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Files_createChanges_example
import Foundation

let headers = [
  "Authorization": "Bearer <API key>",
  "Content-Type": "application/json"
]
let parameters = ["changes": [
    [
      "type": "deleted",
      "path": "parts/old-bracket.prt"
    ],
    [
      "type": "renamed",
      "path": "parts/bracket.prt",
      "newPath": "parts/housing-bracket.prt"
    ]
  ]] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.cadrooms.workers.dev/v1/projects/6c83044f-ec8a-4a01-8a6b-e8b3eb988d2b/changes")! 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()
```