# Upload Profile Image from URL Upload a profile image by providing a URL. The image is downloaded, validated, and processed automatically. ## Request Body **`image_url`** string required Public URL to the image file. ## Supported Formats - JPEG/JPG - PNG (including transparency) - WebP - GIF ## Automatic Processing - **Download**: Fetches image from provided URL - **Validation**: File type, size (10MB max), corruption check - **Conversion**: All images converted to WebP format - **Multi-size**: Generates 3 versions: - Thumbnail: 150x150px - Medium: 500x500px - Full: 1200x1200px - **Storage**: GCS bucket `freddy-profile-images` (Europe region) - **Update**: Auto-updates user's `profile_image` field ## Returns URLs for all generated image sizes (thumbnail, medium, full) in WebP format. All images are publicly accessible via GCS. Upload from URL ```bash curl -X POST \ "https://api.aitronos.com/v1/user/profile/image/url" \ -H "X-API-Key: $FREDDY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "image_url": "https://example.com/avatar.jpg" }' ``` ```python import requests response = requests.post( "https://api.aitronos.com/v1/user/profile/image/url", headers={"Authorization": f"Bearer {FREDDY_API_KEY}"}, json={"image_url": "https://example.com/avatar.jpg"} ) urls = response.json()["urls"] print(f"Profile image updated: {urls['medium']}") ``` ```javascript const response = await fetch('https://api.aitronos.com/v1/user/profile/image/url', { method: 'POST', headers: { 'Authorization': `Bearer ${FREDDY_API_KEY}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ image_url: 'https://example.com/avatar.jpg' }) }); const data = await response.json(); console.log('Profile image updated:', data.urls.medium); ``` **Response:** 200 OK ```json { "success": true, "message": "Profile image uploaded successfully", "urls": { "thumbnail": "https://storage.googleapis.com/freddy-profile-images/profile-images/usr_123e4567e89b12d3a456426614174000/def456_thumbnail.webp", "medium": "https://storage.googleapis.com/freddy-profile-images/profile-images/usr_123e4567e89b12d3a456426614174000/def456_medium.webp", "full": "https://storage.googleapis.com/freddy-profile-images/profile-images/usr_123e4567e89b12d3a456426614174000/def456_full.webp" } } ``` 401 Unauthorized ```json { "success": false, "error": { "code": "AUTHENTICATION_REQUIRED", "message": "Authentication required to access this resource", "system_message": "Authentication required", "type": "client_error", "status": 401, "trace_id": "trace_abc123", "timestamp": "2025-11-13T10:30:00Z" } } ``` 422 Validation Error ```json { "success": false, "error": { "code": "URL_DOWNLOAD_FAILED", "message": "Failed to download image from provided URL", "system_message": "Image download failed", "type": "client_error", "status": 422, "trace_id": "trace_abc123", "timestamp": "2025-11-13T10:30:00Z", "details": { "url": "https://example.com/avatar.jpg", "reason": "Invalid URL or inaccessible resource" } } } ```