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

# Mint signed upload URL

> Get a direct-to-storage signed upload URL for large files, then register the finished upload as a media library asset.

Mints a short-lived **signed upload URL** so the file bytes go directly to
storage without passing through the API server. Use this for files too large
for [POST /uploads](/docs/api-reference/uploads/create) (or whenever you want to
skip the server hop).

## The 3-step flow

<Steps>
  <Step title="Mint the URL">
    `POST /uploads/signed-url` with a `fileName`. The response contains
    `uploadUrl` and `blobName`.
  </Step>

  <Step title="PUT the file bytes">
    `PUT` the raw file to `uploadUrl` with the correct `Content-Type` header.
  </Step>

  <Step title="Register the asset">
    `POST` [`/uploads/complete`](/docs/api-reference/uploads/complete) with the
    `blobName` — this verifies the object exists and records it in your media
    library.
  </Step>
</Steps>

<Warning>
  The upload is **not** in your library until you call
  [`/uploads/complete`](/docs/api-reference/uploads/complete). Unregistered blobs are
  not listed and cannot be managed via the API.
</Warning>

## Example

```bash theme={null}
# 1. Mint
RESPONSE=$(curl -s -X POST "https://mvp2.tryunsora.com/api/v1/uploads/signed-url" \
  -H "Authorization: Bearer uns_live_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "fileName": "big-video.mp4" }')

UPLOAD_URL=$(echo "$RESPONSE" | jq -r .data.uploadUrl)
BLOB_NAME=$(echo "$RESPONSE" | jq -r .data.blobName)

# 2. PUT the bytes straight to storage
curl -X PUT "$UPLOAD_URL" \
  -H "Content-Type: video/mp4" \
  --data-binary @big-video.mp4

# 3. Register the asset
curl -X POST "https://mvp2.tryunsora.com/api/v1/uploads/complete" \
  -H "Authorization: Bearer uns_live_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{ \"blobName\": \"$BLOB_NAME\", \"fileName\": \"big-video.mp4\" }"
```

<Tip>
  The [Unsora CLI](/docs/cli/quickstart) does this automatically:
  `unsora upload ./big-video.mp4`.
</Tip>


## OpenAPI

````yaml POST /uploads/signed-url
openapi: 3.1.0
info:
  title: Unsora API
  version: 1.2.0
  description: >-
    Public API for Unsora integrations. Use Bearer token from Clerk in
    Authorization header.
servers:
  - url: /api/v1
    description: Versioned API
security: []
tags:
  - name: User
  - name: Connect
  - name: Stripe
  - name: Video
  - name: Image
  - name: Influencer
  - name: Thumbnail
  - name: Clipping
  - name: Music
  - name: Voiceover
  - name: Uploads
paths:
  /uploads/signed-url:
    post:
      tags:
        - Uploads
      summary: Mint a signed direct-upload URL (large files)
      description: >-
        Mints a short-lived signed URL so the file bytes go directly to storage
        without passing through the API (use for files too large for POST
        /uploads). Flow: 1) call this with fileName; 2) PUT the file bytes to
        `uploadUrl` with the correct Content-Type header; 3) POST
        /uploads/complete with the returned `blobName` to register the file in
        your media library.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - fileName
              properties:
                fileName:
                  type: string
      responses:
        '200':
          description: Signed upload URL
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: object
                    properties:
                      uploadUrl:
                        type: string
                        description: PUT the file bytes here.
                      token:
                        type: string
                      publicUrl:
                        type: string
                        description: Public URL the file will have after upload.
                      blobName:
                        type: string
                        description: Pass to POST /uploads/complete.
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````