Get upload URL

Request a presigned URL for uploading a media file directly to storage. The returned URL is valid for 1 hour.

Upload Process:

  1. Call this endpoint with the filename
  2. Use the returned upload_url to upload your file via HTTP PUT
  3. After successful upload, call POST /v1/media/{id}/confirm to finalize

Example upload with curl:

curl -X PUT -T "your-file.jpg" -H "Content-Type: image/jpeg" "<upload_url>"
POST/v1/media/upload
filenamestring

The filename for the media file. Should include the file extension.

Length1 <= length <= 255
content_type?string

The MIME type of the file. If not provided, it will be inferred from the filename extension.

Length1 <= length

Response Body

curl -X POST "https://api.outstand.so/v1/media/upload" \  -H "Content-Type: application/json" \  -d '{    "filename": "product-image.jpg"  }'
{
  "success": true,
  "data": {
    "id": "9dyJS",
    "upload_url": "https://media-bucket.r2.cloudflarestorage.com/...",
    "expires_in": 3600
  }
}
{
  "success": false,
  "error": "Invalid request",
  "details": {
    "filename": {
      "_errors": [
        "Required"
      ]
    }
  }
}
{
  "success": false,
  "error": "Internal server error",
  "message": "Failed to generate upload URL"
}