> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dreep.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# Confirm Upload

> Finalise a presigned upload with client.ConfirmUpload() once its bytes are in storage.

Verifies the object exists, reads its metadata, applies any transform, and flips the asset
to `ready`. Until this is called the asset stays `pending` and is excluded from media
listings.

```go theme={null}
asset, err := client.ConfirmUpload(ctx, upload.ID, nil)
```

## Signature

```go theme={null}
func (c *Client) ConfirmUpload(ctx context.Context, id string, o *dreep.ConfirmOptions) (*dreep.MediaAsset, error)
```

| Parameter | Type | Description |
| :- | :- | :- |
| `id` | `string` | **Required.** The `ID` returned by [`PresignUpload`](/go-sdk/upload/create-presigned-upload) |
| `o` | `*dreep.ConfirmOptions` | Optional. Pass `nil` for none |

### `ConfirmOptions`

| Field | Type | Description |
| :- | :- | :- |
| `Transform` | [`*dreep.Transform`](/go-sdk/media/build-url#transform-fields) | Applied before the asset goes `ready` |
| `PresetKey` | `string` | A saved preset to apply |

## Returns

The stored [`*dreep.MediaAsset`](/go-sdk/upload/upload-media#returns). The call is
idempotent: an asset that is already `ready` is returned as-is. If the API answers with an
empty body, the asset and the error are both `nil`.

## Transforming on confirm

```go theme={null}
asset, err := client.ConfirmUpload(ctx, upload.ID, &dreep.ConfirmOptions{
    Transform: &dreep.Transform{Width: 1200, Format: dreep.FormatWebP},
})
```

## Errors

| Check | Cause |
| :- | :- |
| `dreep.IsConflict(err)` | The bytes haven't finished uploading to storage yet |
| `dreep.IsNotFound(err)` | No presigned upload with that id |

`IsConflict` means the `PUT` hasn't landed — retry the confirm, not the upload.
[`UploadPresigned`](/go-sdk/upload/create-presigned-upload#one-call-uploadpresigned) does
this for you.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.