API ReferenceUpload
Get presigned upload URL
Returns a presigned URL for uploading a file to Bag's storage (Cloudflare R2). Upload the file directly to the returned URL using a PUT request with the file contents as the body.
Authorization
privy AuthorizationBearer <token>
Privy JWT authentication for dashboard and management endpoints. This is used internally by the Bag Dashboard and is not intended for direct API integrations. Use API keys instead.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
curl -X POST "https://api.justusebag.xyz/api/upload" \ -H "Content-Type: application/json" \ -d '{ "fileType": "image/png", "fileName": "company-logo.png", "fileSize": 245760 }'{
"status": "success",
"data": {
"uploadUrl": "https://r2.justusebag.xyz/uploads/merchants/0x1a2B/company-logo.png?X-Amz-Signature=...",
"key": "merchants/0x1a2B/company-logo.png",
"publicUrl": "https://cdn.justusebag.xyz/merchants/0x1a2B/company-logo.png"
}
}{
"status": "error",
"message": "Invalid or revoked API key",
"code": "UNAUTHORIZED",
"hint": "Include a valid API key in the Authorization header: Bearer bag_live_sk_..."
}