Graniite Docs

Step 2: PUT the file bytes to Storage

Direct PUT from the client to the signed Supabase Storage URL returned by Step 1. Not a Graniite endpoint — the binary never traverses our application servers.

This step lives between Step 1 (request a signed URL) and Step 3 (finalize media or finalize document).

It isn't a Graniite endpoint, which is why it doesn't appear in the auto-generated REST reference. You PUT the file bytes directly to the signed_url returned by Step 1 — the upload goes straight to Supabase Storage, bypassing Vercel's 4.5 MB request-body cap and our application servers entirely.

Request

FieldValue
MethodPUT
URLthe signed_url from Step 1
Authnone — the signed URL carries its own short-lived token
HeadersContent-Type: <mime from Step 1>
Bodyraw file bytes

The Content-Type you send here must match exactly what you declared to /uploads/signed-url. A mismatch will not error here — Storage accepts the PUT — but the magic-byte verification at finalize time will reject the upload.

curl

curl -X PUT "<signed_url from Step 1>" \
  -H "Content-Type: audio/mpeg" \
  --data-binary @meeting.mp3

A successful PUT returns 200 OK with an empty body. Hold on to the path, mime, and filename you used in Step 1 — Step 3 needs all three.

Common failures

  • 403 / signature mismatch — the signed URL has expired (single-use, ~minutes). Call Step 1 again to get a fresh one.
  • Content-Type rejected — the header you sent doesn't match what Step 1 declared, or it isn't in the bucket's allowlist. Send the same MIME you registered.
  • Body too large for your client — Vercel's cap doesn't apply here (you're talking to Supabase, not us), but your HTTP client may have its own buffer limits. --data-binary in curl streams without buffering; in code, use a streaming request body.

Next

Call Step 3 to finalize. The finalize_endpoint field in Step 1's response tells you which one to use:

  • finalize → audio/video uploads (queues transcription).
  • finalize-document → PDF/image uploads (extracts text synchronously).

For the full end-to-end flow with code samples, see the Binary Upload quickstart.

On this page