Get presigned upload URL
Get a presigned URL for uploading a file. This is the first step in a two-step upload flow.
Upload Flow:
- Call this endpoint to get a presigned URL and metadata
- PUT the file to the returned URL with the required headers
Required headers for the PUT request:
Content-Type: Usemetadata.contentTypefrom the responsex-amz-meta-file-type: Usemetadata.contentTypefrom the responsex-amz-meta-org-id: Usemetadata.orgIdfrom the responsex-amz-meta-user-id: Usemetadata.userIdfrom the response
Presigned URLs expire after 10 minutes.
Authorizations
JWT token from Clerk authentication.
Must be from a user with org:admin role.
Body
Response
Presigned URL generated successfully
The presigned URL to upload the file to
"https://account-id.r2.cloudflarestorage.com/bucket/..."
The HTTP method to use (always PUT)
PUT "PUT"
Unique identifier for the uploaded file
"550e8400-e29b-41d4-a716-446655440000"
The storage key/path where the file will be stored
"org_xxx/uploads/550e8400-e29b-41d4-a716-446655440000/report.pdf"
The storage key for extracted text content (for documents)
"org_xxx/contents/550e8400-e29b-41d4-a716-446655440000.md"
Values that MUST be included as headers when uploading to the presigned URL
