Get a presigned URL for uploading a file. This is the first step in a two-step upload flow.
Upload Flow:
Required headers for the PUT request:
Content-Type: Use metadata.contentType from the responsex-amz-meta-file-type: Use metadata.contentType from the responsex-amz-meta-org-id: Use metadata.orgId from the responsex-amz-meta-user-id: Use metadata.userId from the responsePresigned URLs expire after 10 minutes.
JWT token from Clerk authentication.
Must be from a user with org:admin role.
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