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

# Complete Image Upload

> Register an uploaded image in the shared media library

After uploading image bytes to the authenticated URL from [Create Image Upload
URL](/api-reference/media/upload-url), register the returned company-scoped
`key`. Completion is idempotent, so retrying the same key returns the existing
asset instead of creating a duplicate. The response contains the permanent
hosted URL to use as an image block's `src`.

## Request

<ParamField body="key" type="string" required>
  Storage key returned by the upload-url endpoint. It must belong to the
  authenticated company.
</ParamField>

<ParamField body="filename" type="string" required>
  Hosted image file name.
</ParamField>

<ParamField body="contentType" type="string" required>
  Uploaded image MIME type: PNG, JPEG, GIF, or WebP.
</ParamField>

<ParamField body="fileSizeBytes" type="number" required>
  Exact uploaded image size in bytes.
</ParamField>

<ParamField body="width" type="integer">
  Optional intrinsic image width in pixels.
</ParamField>

<ParamField body="height" type="integer">
  Optional intrinsic image height in pixels.
</ParamField>

<ParamField body="altText" type="string" required>
  Accessible image description, or an empty string for a decorative image.
</ParamField>

```bash theme={null}
curl -X POST "https://api.sequenzy.com/api/v1/media/complete-upload" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "key":"email-images/comp_123/.../product-shot.png",
    "filename":"product-shot.png",
    "contentType":"image/png",
    "fileSizeBytes":248132,
    "width":1440,
    "height":900,
    "altText":"HeyStream product results screen"
  }'
```

## Responses

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "asset": {
      "id": "media_123",
      "filename": "product-shot.png",
      "url": "https://images.sequenzy.com/email-images/comp_123/.../product-shot.png",
      "mimeType": "image/png",
      "size": "248132",
      "width": "1440",
      "height": "900",
      "altText": "HeyStream product results screen",
      "companyId": "comp_123"
    }
  }
  ```

  ```json 400 theme={null}
  {
    "success": false,
    "error": "The uploaded image key is invalid for this company."
  }
  ```

  ```json 409 theme={null}
  {
    "success": false,
    "error": "The uploaded image changed during verification. Start a new upload."
  }
  ```
</ResponseExample>
