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

# Complete a multipart upload

PATCH https://api.dsx-air.nvidia.com/api/v3/images/{id}/complete-upload/
Content-Type: application/json

Finalize a multipart upload by providing ETags from each uploaded part.

**Process**:
1. Collect the `ETag` header from each part upload response
2. Call this endpoint with the list of parts and their ETags
3. S3 combines parts and validates ETags
4. Image transitions to VALIDATING status
5. Async validation verifies file size and hash match declared values
6. Image transitions to COMPLETE status after validation

**Validation**: S3 validates ETags; async task validates size and hash. This endpoint returns once the image enters `VALIDATING`; clients should poll the image until `upload_status` becomes `COMPLETE`.

**Required scope:** `air:image_write` (roles: `air_image_publisher`, `air_image_uploader`)

Reference: https://docs.nvidia.com/dsx-air/api-reference/images/image-complete-multipart-upload

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `id` (string, required) — A UUID string identifying this image.

### Body (application/json)

This endpoint expects an object.

- `parts` (list of object, optional) — List of parts with part_number and etag from S3 upload responses.
  - `part_number` (integer, required) — The part number (1-10000).
  - `etag` (string, required) — The ETag returned by S3 after uploading the part.

## Response

### 200

- `id` (string, required)
- `name` (string, required) — The `name` of the image. This must be unique with the `version`.
- `version` (string, required) — The `version` of the image. This must be unique with the `name`.
- `created` (datetime, required)
- `creator` (string, required, nullable) — The email of the user who created the image.
- `modified` (datetime, required)
- `default_username` (string, required) — The default username for authenticating with the operating system.
- `default_password` (string, required) — The default password for authenticating with the operating system.
- `published` (boolean, required) — Whether the image is published.
- `publicly_published` (boolean, required) — Whether the image is published to all users (public) vs restricted to an allow-list. Always `false` for unpublished images.
- `publish_access_record_id` (string, required, nullable) — The id of the image publish access record. Returned only to the owning organization, Air admins, and SREs; null otherwise.
- `upload_status` (enum, required) — The upload status of the image file. * `READY` - Ready * `UPLOADING` - Uploading * `VALIDATING` - Validating * `COMPLETE` - Complete * `PUBLISHING` - Publishing * `UNPUBLISHING` - Unpublishing * `COPYING_FROM_IMAGE_SHARE` - Copying from image share * `PENDING_PUBLISH` - Pending Publish * `PENDING_UNPUBLISH` - Pending Unpublish
  - Allowed values: `READY`, `UPLOADING`, `VALIDATING`, `COMPLETE`, `PUBLISHING`, `UNPUBLISHING`, `COPYING_FROM_IMAGE_SHARE`, `PENDING_PUBLISH`, `PENDING_UNPUBLISH`
- `last_uploaded_at` (datetime, required, nullable) — The date and time the image was last uploaded.
- `size` (integer, required) — The size of the image file in bytes.
- `hash` (string, required) — The hash of the image file. This is used to check if the content of the image has changed.
- `is_owned_by_client` (boolean, required) — If the image is owned by the client. When true, the client can share/publish/unpublish the image.
- `mountpoint` (string, optional, nullable) — Partition that hosts the operating system root file system.
- `minimum_resources` (object, optional) — The minimum resources required to run the image.
  - `cpu` (integer, required) — The minimum number of CPU cores required to run the image.
  - `memory` (integer, required) — The minimum amount of memory required to run the image.
  - `storage` (integer, required) — The minimum amount of storage required to run the image.
- `includes_air_agent` (boolean, optional, default: false) — Whether the image includes the Air Agent service.
- `cpu_arch` (enum, optional, default: x86) — The CPU architecture of the image. * `x86` - x86 * `ARM` - ARM
  - Allowed values: `x86`, `ARM`
- `emulation_type` (list of string, optional) — The types of emulation the image supports.
- `emulation_version` (string, optional) — The version of the emulation the image supports.
- `provider` (enum, optional, default: VM) — The provider of the image. * `VM` - VM * `CONTAINER` - CONTAINER
  - Allowed values: `VM`, `CONTAINER`
- `notes` (string, optional) — Notes about the image.
- `release_notes` (string, optional) — Release notes for the image.
- `user_manual` (string, optional) — User manual for the image.

## Errors

### 400 Bad Request Error

- `detail` (string, required) — Description of an error.
- `request_id` (string, required, nullable) — ID assigned to the request which encountered the error. Should be provided when opening a support case.
- `type` (enum, required) — Specific type of a 400 error. * `PROTECTED` - Instance may not be deleted as it is being referenced by other instances. * `VALIDATION` - Validation errors encountered during payload processing.
  - Allowed values: `PROTECTED`, `VALIDATION`
- `protected_instances` (list of object, optional) — Instances which bar the current instance from being deleted. Only defined when `type` is set to `PROTECTED`.
  - `id` (string, required) — ID of the instance.
  - `type` (string, required) — Type of the instance.
- `validation_errors` (map from string to list of object or object or map from string to any or list of object, optional) — Validation errors encountered during payload processing. Only defined when `type` is set to `VALIDATION`.

### 403 Forbidden Error

- `detail` (string, required) — Description of an error.
- `request_id` (string, required, nullable) — ID assigned to the request which encountered the error. Should be provided when opening a support case.

### 404 Not Found Error

- `request_id` (string, required, nullable) — ID assigned to the request which encountered the error. Should be provided when opening a support case.
- `detail` (string, optional, default: No object matches the given query.) — Description of an error.

### 500 Internal Server Error

- `request_id` (string, required, nullable) — ID assigned to the request which encountered the error. Should be provided when opening a support case.
- `code` (string, required) — Error code which identifies the error. Should be provided when opening a support case.
- `detail` (string, optional, default: An unexpected error has occurred. Please contact NVIDIA Air support for further assistance.) — Description of an error.

### 502 Bad Gateway Error

- `map from string to any`

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "id": "string",
  "name": "string",
  "version": "string",
  "created": "2024-01-15T09:30:00Z",
  "creator": "string",
  "modified": "2024-01-15T09:30:00Z",
  "default_username": "string",
  "default_password": "string",
  "published": true,
  "publicly_published": true,
  "publish_access_record_id": "string",
  "upload_status": "READY",
  "last_uploaded_at": "2024-01-15T09:30:00Z",
  "size": 1,
  "hash": "string",
  "is_owned_by_client": true,
  "mountpoint": "string",
  "minimum_resources": {
    "cpu": 1,
    "memory": 1,
    "storage": 1
  },
  "includes_air_agent": false,
  "cpu_arch": "x86",
  "emulation_type": [
    "string"
  ],
  "emulation_version": "string",
  "provider": "VM",
  "notes": "string",
  "release_notes": "string",
  "user_manual": "string"
}
```

**SDK Code**

```python
import requests

url = "https://api.dsx-air.nvidia.com/api/v3/images/id/complete-upload/"

payload = {}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.dsx-air.nvidia.com/api/v3/images/id/complete-upload/';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{}'
};

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

```go
package main

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

func main() {

	url := "https://api.dsx-air.nvidia.com/api/v3/images/id/complete-upload/"

	payload := strings.NewReader("{}")

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

	req.Header.Add("Authorization", "Bearer <token>")
	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
require 'uri'
require 'net/http'

url = URI("https://api.dsx-air.nvidia.com/api/v3/images/id/complete-upload/")

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

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"

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

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

HttpResponse<String> response = Unirest.patch("https://api.dsx-air.nvidia.com/api/v3/images/id/complete-upload/")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.dsx-air.nvidia.com/api/v3/images/id/complete-upload/', [
  'body' => '{}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.dsx-air.nvidia.com/api/v3/images/id/complete-upload/");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.dsx-air.nvidia.com/api/v3/images/id/complete-upload/")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
```