Skip to main content

Get Attachment

GET 

/api/upload/:tenant_id/attachment/:filename

Get an attachment by its filename.

This endpoint:

  1. Downloads attachment data from Backblaze using tenant-specific folder structure
  2. Returns the attachment as response

The endpoint supports authentication via:

  1. JWT authentication in cookies (web_context) - for browser requests
  2. JWT authentication in Authorization header (web_context) - for API requests

URL structure: /api/upload/{tenant_id}/attachment/{filename} Storage location: uploads/{tenant_id}/attachments/{filename}

Args: tenant_id: Tenant ID for folder isolation filename: The attachment filename (UUID with extension) request: FastAPI request object (used to read cookies) web_context: Optional web context from authentication

Returns: Attachment response with proper content type

Raises: 404: Attachment not found 400: Validation error 500: Internal server error

Request

Responses

Successful Response