v2 - Media

Request a signed URL for upload

Start the upload process by requesting a signed URL.

The frontend should:
1. Call this endpoint with filename and optional content_type
2. Use the returned signed_url to PUT the file directly to GCS
3. Call /v2/media/{media_id}/upload/complete when done

The signed URL is valid for 10 minutes.
post/v2/media/upload/request

Request

  • Base URL
    https://api.jubjubapp.com (the document declares no server; this is the origin it was published from)
  • Auth
    HTTP bearer

Headers

Authorizationstring
X-JubJub-Service-Keystring
X-JubJub-Agent-Keystring
X-JubJub-Platform-Keystring
Originstring
Refererstring
X-JubJub-Trial-Tokenstring

Request body

workspace_idstring required

Workspace that will own this media

filenamestring required

Original filename (e.g., 'video.mp4'). Used to detect content_type if not provided.

content_typestring nullable

MIME type. Auto-detected from filename extension if not provided.

media_type'video' | 'image' | 'subtitle' | 'document'

Type of media being uploaded. document is a PDF. An image/* or application/pdf mime sent with the default video is stored as an image or a document.

size_bytesinteger nullable

Total file size in bytes. REQUIRED for a document (PDF, at most 25 MB) and an image (at most 30 MB): 400 without it, 413 over the cap. When provided, the backend also returns a resumable_url for chunked uploads.

Example request

{
  "filename": "my_video.mp4",
  "content_type": "video/mp4"
}

Response

Successful Response

media_idstring required

ID of the created Media record

signed_urlstring required

Signed URL for single PUT upload. Use for small files or as fallback.

resumable_urlstring nullable

Resumable session URL for chunked uploads. Use PUT with Content-Range headers. Available when size_bytes is provided in the request.

expires_atstring date-time required

When the signed URL expires. Upload must complete before this.

gcs_pathstring required

Path where the file will be stored in GCS.

content_typestring required

Content-Type header to use when uploading.

Changes

No recorded changes to this operation across all 1 revision of this API.