Skip to Content

Storage

File storage, media processing, and content management.

Overview

Content management is handled by four services:

ServicePortPurpose
storage_service8209File upload, sharing, versioning
album_service8219Photo albums, collections
media_service8222Transcoding, thumbnails
document_service8227Documents, OCR, text extraction

Storage Service (8209)

Upload File

curl -X POST "http://localhost:8209/api/v1/storage/upload" \ -H "Authorization: Bearer YOUR_JWT_TOKEN" \ -F "file=@/path/to/photo.jpg" \ -F "folder=photos"

Download File

curl "http://localhost:8209/api/v1/storage/files/file_abc123/download" \ -H "Authorization: Bearer YOUR_JWT_TOKEN" \ -o downloaded_file.jpg
curl -X POST "http://localhost:8209/api/v1/storage/files/file_abc123/share" \ -H "Authorization: Bearer YOUR_JWT_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "visibility": "public", "expires_in_days": 7 }'

Storage Quota

curl "http://localhost:8209/api/v1/storage/quota" \ -H "Authorization: Bearer YOUR_JWT_TOKEN"

Album Service (8219)

Create Album

curl -X POST "http://localhost:8219/api/v1/albums" \ -H "Authorization: Bearer YOUR_JWT_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "Summer Vacation 2024", "description": "Photos from our trip" }'

Add Photos to Album

curl -X POST "http://localhost:8219/api/v1/albums/album_123/photos" \ -H "Authorization: Bearer YOUR_JWT_TOKEN" \ -H "Content-Type: application/json" \ -d '{"file_ids": ["file_abc123", "file_def456"]}'

Media Service (8222)

Generate Thumbnail

curl -X POST "http://localhost:8222/api/v1/media/thumbnail" \ -H "Authorization: Bearer YOUR_JWT_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "file_id": "file_abc123", "width": 200, "height": 200, "format": "webp" }'

Transcode Video

curl -X POST "http://localhost:8222/api/v1/media/transcode" \ -H "Authorization: Bearer YOUR_JWT_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "file_id": "file_video123", "output_format": "mp4", "quality": "720p" }'

Document Service (8227)

Upload Document with OCR

curl -X POST "http://localhost:8227/api/v1/documents" \ -H "Authorization: Bearer YOUR_JWT_TOKEN" \ -F "file=@/path/to/document.pdf" \ -F "extract_text=true"

Supported Formats

InputOutputOperations
JPEG, PNG, WebPJPEG, PNG, WebP, AVIFResize, crop, rotate
MP4, MOV, AVIMP4, WebMTranscode, compress
MP3, WAV, M4AMP3, AACConvert, normalize
curl -X POST "http://localhost:8209/api/v1/storage/search" \ -H "Authorization: Bearer YOUR_JWT_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "query": "sunset beach vacation", "type": "semantic", "limit": 20 }'

Python SDK

from isa_user import StorageClient, AlbumClient storage = StorageClient("http://localhost:8209") albums = AlbumClient("http://localhost:8219") # Upload file file = await storage.upload( token=access_token, file_path="/path/to/photo.jpg", folder="photos" ) # Create album album = await albums.create( token=access_token, name="Vacation 2024", file_ids=[file.file_id] ) # Semantic search results = await storage.search( token=access_token, query="beach sunset", type="semantic" )

Next Steps