Graniite Docs

Step 1: get a signed Storage URL for a binary upload.

Three-step binary upload, step 1 of 3. The server validates the declared MIME + size against the appropriate bucket's allowlist (media-uploads for audio/video, document-uploads for PDF/image), generates a single-use signed URL the client PUTs bytes to directly, and returns the path + which finalize endpoint to call next. Vercel caps request bodies at 4.5 MB; this flow exists because direct-to-Storage upload bypasses that limit. Rate limit: 30/hr per token.

POST
/uploads/signed-url

Three-step binary upload, step 1 of 3. The server validates the declared MIME + size against the appropriate bucket's allowlist (media-uploads for audio/video, document-uploads for PDF/image), generates a single-use signed URL the client PUTs bytes to directly, and returns the path + which finalize endpoint to call next. Vercel caps request bodies at 4.5 MB; this flow exists because direct-to-Storage upload bypasses that limit. Rate limit: 30/hr per token.

Authorization

bearerAuth
AuthorizationBearer <token>

Per-user bearer token minted at /settings/integrations. Format: 'lev_' followed by 32 base64url chars. Each token carries a capability set (read | write) and a folder scope (whole library or a list of specific folders). Per-endpoint requirements are noted on each operation.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/uploads/signed-url" \  -H "Content-Type: application/json" \  -d '{    "mime": "audio/mpeg",    "size": 1  }'
{
  "bucket": "media-uploads",
  "path": "string",
  "token": "string",
  "signed_url": "http://example.com",
  "mime": "string",
  "kind": "audio",
  "extension": "mp3",
  "max_bytes": 0,
  "finalize_endpoint": "/api/v1/uploads/finalize"
}
{
  "error": "string",
  "message": "string"
}
{
  "error": "string",
  "message": "string"
}
{
  "error": "string",
  "message": "string"
}
{
  "error": "string",
  "message": "string"
}
{
  "error": "rate_limited",
  "retry_after_sec": 0
}
{
  "error": "string",
  "message": "string"
}