Uploads
File upload via presigned URLs (Cloudflare R2). Requires authentication.
POST /uploads/presign
Get a presigned URL to upload a file.
curl -X POST https://api.paylinks.ro/api/v1/uploads/presign \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"filename": "product.pdf", "contentType": "application/pdf"}'
Request Body:
| Field | Type | Required | Description |
|---|---|---|---|
filename | string | Yes | File name |
contentType | string | Yes | MIME type (e.g., application/pdf, image/png) |
Response (200):
{
"uploadUrl": "https://r2.paylinks.ro/presigned-upload-url...",
"fileUrl": "https://files.paylinks.ro/uploads/abc123/product.pdf"
}
Upload Flow
- Call
POST /uploads/presignto get a presigned URL PUTthe file contents to theuploadUrl- Use the
fileUrlin paylink fields (imageUrl,fileUrl)
# Step 2: Upload the file
curl -X PUT "https://r2.paylinks.ro/presigned-upload-url..." \
-H "Content-Type: application/pdf" \
--data-binary @product.pdf