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

# Create Upload URL

> Get a presigned URL to upload a distributable file

Returns a presigned URL to upload a distributable file to Sequenzy storage. PUT the file bytes to `uploadUrl`, then attach `publicUrl` to a product with [Attach Delivery File](/api-reference/products/attach-delivery).

Allowed types: PDF, ePub, ZIP, images, audio, video, and text files, up to 100MB. Files are stored under unguessable URLs.

## Request

<ParamField body="filename" type="string" required>
  Original file name (used to build the hosted file name).
</ParamField>

<ParamField body="contentType" type="string" required>
  File MIME type, e.g. `application/pdf`.
</ParamField>

<ParamField body="fileSizeBytes" type="number" required>
  File size in bytes (max 104857600).
</ParamField>

```bash theme={null}
curl -X POST "https://api.sequenzy.com/api/v1/products/delivery/upload-url" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"filename": "guide.pdf", "contentType": "application/pdf", "fileSizeBytes": 1048576}'

# Then upload the file bytes:
curl -X PUT "UPLOAD_URL_FROM_RESPONSE" \
  -H "Content-Type: application/pdf" \
  --data-binary @guide.pdf
```

## Responses

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "uploadUrl": "https://...r2.cloudflarestorage.com/...",
    "publicUrl": "https://images.sequenzy.com/product-files/comp_123/9f2.../guide.pdf",
    "fileName": "guide.pdf"
  }
  ```

  ```json 400 theme={null}
  {
    "success": false,
    "error": "Unsupported file type. Use PDF, ePub, ZIP, image, audio, video, or text files."
  }
  ```

  ```json 401 theme={null}
  {
    "success": false,
    "error": "Invalid or missing API key"
  }
  ```

  ```json 503 theme={null}
  {
    "success": false,
    "error": "File uploads are not configured on this server. Attach an external URL instead."
  }
  ```
</ResponseExample>
