# io.atcr.hold.completeUpload

> Finalize a multipart upload and move the assembled blob to its final location.

- Kind: procedure
- Authority: hold.atcr.io
- Lexicon: 1
- Published by [did:web:lexicon.atcr.io](https://lexicon.garden/identity/did:web:lexicon.atcr.io), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:web:lexicon.atcr.io/io.atcr.hold.completeUpload)
- [Schema JSON](https://lexicon.garden/lexicon/did:web:lexicon.atcr.io/io.atcr.hold.completeUpload/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:web:lexicon.atcr.io/io.atcr.hold.completeUpload/analytics)

## Procedure (`io.atcr.hold.completeUpload`)

Type: procedure · POST

### Input (application/json)

- `digest` (string, required): Final blob digest (e.g., sha256:abc123...)
  - Constraints: maxLength: 128
- `parts` (array, required): List of uploaded parts with their ETags
  - `items` (ref)
    - Reference: `#partInfo`
- `uploadId` (string, required): Upload session ID from initiateUpload
  - Constraints: maxLength: 256

### Output (application/json)

- `digest` (string, required): The digest of the completed blob
  - Constraints: maxLength: 128
- `status` (string, required): Always 'completed' on success
  - Constraints: maxLength: 16, const: "completed"

### Errors

- `InvalidUploadId`: No description in schema.
- `InvalidDigest`: No description in schema.
- `MissingParts`: No description in schema.
- `CompletionFailed`: No description in schema.

## #partInfo (`io.atcr.hold.completeUpload#partInfo`)

Type: object

Information about a completed upload part

### Properties

- `etag` (string, required): ETag returned when the part was uploaded
  - Constraints: maxLength: 256
- `partNumber` (integer, required): Part sequence number (1-indexed)
  - Constraints: minimum: 1

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Finalize a multipart upload and move the assembled blob to its final location.",
      "errors": [
        {
          "name": "InvalidUploadId"
        },
        {
          "name": "InvalidDigest"
        },
        {
          "name": "MissingParts"
        },
        {
          "name": "CompletionFailed"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "digest": {
              "description": "Final blob digest (e.g., sha256:abc123...)",
              "maxLength": 128,
              "type": "string"
            },
            "parts": {
              "description": "List of uploaded parts with their ETags",
              "items": {
                "ref": "#partInfo",
                "type": "ref"
              },
              "type": "array"
            },
            "uploadId": {
              "description": "Upload session ID from initiateUpload",
              "maxLength": 256,
              "type": "string"
            }
          },
          "required": [
            "uploadId",
            "digest",
            "parts"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "digest": {
              "description": "The digest of the completed blob",
              "maxLength": 128,
              "type": "string"
            },
            "status": {
              "const": "completed",
              "description": "Always 'completed' on success",
              "maxLength": 16,
              "type": "string"
            }
          },
          "required": [
            "status",
            "digest"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    },
    "partInfo": {
      "description": "Information about a completed upload part",
      "properties": {
        "etag": {
          "description": "ETag returned when the part was uploaded",
          "maxLength": 256,
          "type": "string"
        },
        "partNumber": {
          "description": "Part sequence number (1-indexed)",
          "minimum": 1,
          "type": "integer"
        }
      },
      "required": [
        "partNumber",
        "etag"
      ],
      "type": "object"
    }
  },
  "id": "io.atcr.hold.completeUpload",
  "lexicon": 1
}
```
