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

# Complete an attachment

POST https://api.cadrooms.workers.dev/v1/attachments/{attachmentId}/complete
Content-Type: application/json

Confirms that the attachment content has been uploaded. CAD ROOMS retrieves its size and checksum from storage. Set `convertFile` to initiate CAD processing, allowing the attachment to be loaded in the 3D view. The request fails if the attachment is already complete.

You can complete a thumbnail only if you created it.

Required permission: Collaborator or higher in the project.


Reference: https://docs.cadrooms.com/api-reference/annotations/complete-attachment

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

- `attachmentId` (string, required) — Unique identifier of the attachment.

### Body (application/json)

This endpoint expects an object.

- `contentType` (string, required) — Content type of the uploaded file.
- `convertFile` (boolean, optional, default: false) — Starts CAD processing for the attachment.

## Response

### 200

Returns the completed attachment.

- `id` (string, required) — Unique identifier of the attachment.
- `projectId` (string, required) — ID of the project.
- `path` (string, required) — Name of the attachment file.
- `contentType` (string, required, nullable) — Content type of the file, or `null` if unknown.
- `sizeBytes` (integer, required, nullable) — Size of the file in bytes, or `null` until the attachment is complete.
- `processingStatus` (enum, required) — CAD processing status. It stays `pending` unless CAD processing was started.
  - Allowed values: `pending`, `processing`, `completed`, `failed`, `incompatible`
- `processingError` (string, required, nullable) — Why CAD processing failed, or `null` if it did not fail.
- `createdAt` (datetime, required) — Time at which the attachment was created.
- `downloadUrl` (string, optional) — Temporary, signed URL of the content. Returned when you get an attachment.

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

### 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
{
  "contentType": "application/pdf",
  "convertFile": false
}
```

**Response**

```json
{
  "id": "9e3a7c10-4b2d-4f86-8a15-6d0c2f7b9e41",
  "projectId": "356d9a6c-31e9-4d9c-ad55-de709172d893",
  "path": "inspection-report.pdf",
  "contentType": "application/pdf",
  "sizeBytes": 482113,
  "processingStatus": "pending",
  "processingError": null,
  "createdAt": "2026-10-09T09:00:00Z"
}
```

**SDK Code**

```python Annotations_completeAttachment_example
import requests

url = "https://api.cadrooms.workers.dev/v1/attachments/c7cb877d-8e7f-4d9e-9bf7-79f285a8df65/complete"

payload = {
    "contentType": "application/pdf",
    "convertFile": False
}
headers = {
    "Authorization": "Bearer <API key>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Annotations_completeAttachment_example
const url = 'https://api.cadrooms.workers.dev/v1/attachments/c7cb877d-8e7f-4d9e-9bf7-79f285a8df65/complete';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <API key>', 'Content-Type': 'application/json'},
  body: '{"contentType":"application/pdf","convertFile":false}'
};

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

```go Annotations_completeAttachment_example
package main

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

func main() {

	url := "https://api.cadrooms.workers.dev/v1/attachments/c7cb877d-8e7f-4d9e-9bf7-79f285a8df65/complete"

	payload := strings.NewReader("{\n  \"contentType\": \"application/pdf\",\n  \"convertFile\": false\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 Annotations_completeAttachment_example
require 'uri'
require 'net/http'

url = URI("https://api.cadrooms.workers.dev/v1/attachments/c7cb877d-8e7f-4d9e-9bf7-79f285a8df65/complete")

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  \"contentType\": \"application/pdf\",\n  \"convertFile\": false\n}"

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

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

HttpResponse<String> response = Unirest.post("https://api.cadrooms.workers.dev/v1/attachments/c7cb877d-8e7f-4d9e-9bf7-79f285a8df65/complete")
  .header("Authorization", "Bearer <API key>")
  .header("Content-Type", "application/json")
  .body("{\n  \"contentType\": \"application/pdf\",\n  \"convertFile\": false\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.cadrooms.workers.dev/v1/attachments/c7cb877d-8e7f-4d9e-9bf7-79f285a8df65/complete', [
  'body' => '{
  "contentType": "application/pdf",
  "convertFile": false
}',
  'headers' => [
    'Authorization' => 'Bearer <API key>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Annotations_completeAttachment_example
using RestSharp;

var client = new RestClient("https://api.cadrooms.workers.dev/v1/attachments/c7cb877d-8e7f-4d9e-9bf7-79f285a8df65/complete");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <API key>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"contentType\": \"application/pdf\",\n  \"convertFile\": false\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Annotations_completeAttachment_example
import Foundation

let headers = [
  "Authorization": "Bearer <API key>",
  "Content-Type": "application/json"
]
let parameters = [
  "contentType": "application/pdf",
  "convertFile": false
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.cadrooms.workers.dev/v1/attachments/c7cb877d-8e7f-4d9e-9bf7-79f285a8df65/complete")! 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()
```