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

> Finalize a presigned upload once the file bytes have reached storage.

The last step of the
[presigned upload flow](/api-reference/upload/create-presigned-upload). Call it
with the `id` returned by the presign request, after the `PUT` to `uploadUrl`
has succeeded.

Dreep verifies the object actually landed in storage, reads its metadata
(dimensions, format, size), applies any transform you pass, and flips the asset
to `ready`.

<Note>
  An asset that is never confirmed stays `pending` forever. Pending assets are
  excluded from [List Media](/api-reference/media/list-media) and are swept up by
  background reconciliation, so an abandoned upload won't show up as a broken
  asset.
</Note>

## Transforming on confirm

Pass `transform` (or `presetKey`) to re-encode the file as part of finalizing
it — the same parameters [Upload Media](/api-reference/upload/upload-media)
accepts.

```bash theme={null}
curl -X POST https://api.dreep.cloud/api/v1/upload/2f928a3f-1d2a-4a2b-8a8b-123456789abc/confirm \
  -H "Authorization: Bearer drp_live_xxxxx" \
  -H "Content-Type: application/json" \
  -d '{ "transform": { "format": "webp", "width": 800 } }'
```

## Responses

| Status | Meaning                                                                                      |
| :----- | :------------------------------------------------------------------------------------------- |
| `200`  | Asset confirmed and ready. Calling again is safe — an already-ready asset is returned as-is. |
| `404`  | No pending upload with that id in this project.                                              |
| `409`  | The file hasn't finished uploading to storage yet. Retry after the `PUT` completes.          |


## OpenAPI

````yaml POST /api/v1/upload/{id}/confirm
openapi: 3.0.0
info:
  title: Dreep API
  description: The universal media processing and storage API.
  version: 1.0.0
servers:
  - url: https://api.dreep.cloud
    description: Production
security:
  - ApiKeyAuth: []
paths:
  /api/v1/upload/{id}/confirm:
    post:
      tags:
        - Upload
      summary: Confirm Upload
      description: >
        Finalize a presigned upload once the bytes have been PUT to storage.
        Dreep 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.
      parameters:
        - name: id
          in: path
          required: true
          description: The `id` returned by the presign call.
          schema:
            type: string
            format: uuid
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                transform:
                  type: object
                  description: >-
                    Transform to apply before storing, same parameters as Upload
                    Media.
                presetKey:
                  type: string
      responses:
        '200':
          description: Upload confirmed
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: Upload not found
        '409':
          description: The file hasn't finished uploading to storage yet
components:
  responses:
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Error:
      type: object
      properties:
        error:
          type: boolean
          example: true
        message:
          type: string
          example: Invalid request parameters
        code:
          type: string
          example: invalid_request
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer

````