Skip to main content

Upload Mms Attachment

POST 

/api/upload/mms

Upload an image for MMS attachment with dual storage:

  1. Backblaze B2 (permanent, authenticated storage)
  2. Redis (temporary public URL, 24h TTL)

MMS-specific requirements:

  • Max 5MB per file (validated by frontend + upload service)
  • Supported formats: JPEG, JPG, PNG, GIF
  • Returns JSONB format with both URLs for MMS sending

Args: file: The image file to upload upload_service: Upload service instance with tenant context

Returns: Dict with JSONB format containing:

  • url: Temporary public URL (for frontend compatibility)
  • storage_url: Permanent Backblaze URL
  • expires_at: ISO timestamp when public URL expires

Raises: 400: Invalid file type or size 503: Storage service unavailable 500: Internal server error

Request

Responses

Successful Response