Cross-Platform User Profile Management & Bunny CDN Image API (Android, iOS, Windows, macOS, Linux)
1. Universal Architecture & Scope
The Pixahunt User Profile & Media API is a unified, high-performance RESTful API designed to manage user identities, profiles, social links, privacy preferences, and official Bunny CDN-powered avatars and cover photos across all supported operating systems:
- Mobile Platforms: Android (Java/Kotlin, Jetpack Compose), iOS (Swift, SwiftUI)
- Desktop Platforms: Windows (.NET MAUI, C#), macOS, Linux
- Cross-Platform Frameworks: Flutter, React Native, Kotlin Multiplatform (KMP), Electron, Tauri
All endpoints are protected by the unified Pixahunt Bearer Token authentication engine. Any user who logs in on the website or mobile/desktop app shares the exact same account and profile seamlessly.
Authentication: Bearer Token (Authorization: Bearer <access_token> or Header: X-App-Token)
Accept: application/json
2. Profile Field Permissions: Editable vs Read-Only Matrix
To ensure system integrity and prevent account takeover or role escalation, user attributes are strictly segmented into Editable and Read-Only fields.
| Field Name | Type & Rules | Permission | Description |
|---|---|---|---|
| fullname | string, max 100 | Editable | Display full name shown on profile and discussion boards. |
| location | string, max 100 | Editable | User's city, state, or country (e.g. "Dhaka, Bangladesh"). |
| about | string, max 2000 | Editable | Personal bio, creative philosophy, or company introduction. |
| website | string/url, max 255 | Editable | Personal portfolio or company website link. |
| emailshow | boolean / integer (0, 1) | Editable | Public email visibility: 1 = visible to public, 0 = hidden. |
| allow_follow | boolean / integer (0, 1) | Editable | Follow permission toggle: 1 = allow followers, 0 = disable. |
| allow_friend | boolean / integer (0, 1) | Editable | Friend request toggle: 1 = allow requests, 0 = disable. |
| msg_privacy | enum: 'everyone', 'friends', 'nobody' | Editable | Direct message privacy setting. |
| showme | boolean / integer (0, 1) | Editable | Whether profile is discoverable in member lists and searches. |
| Social handles | string/url, max 255 each | Editable | behance, dribbble, pinterest, shutterstock, freepik, vecteezy, adobe, lovepik, pngtree. |
| username | string (immutable) | Read-Only | Permanent account identifier. Cannot be edited directly via profile update. |
| email (protected) | Read-Only | User account email. Protected against unauthorized tampering. | |
| status, staff, is_verified, is_contributor, is_customer | system flags | Read-Only | System roles and permission states assigned by administrators. |
3. Official Bunny CDN Architecture & Image Rules
Pixahunt implements a strict CDN-first media pipeline. All images displayed across web, mobile, and desktop applications are processed by the backend and hosted on Bunny CDN.
👤 Avatar Image Rules
- Upload Endpoint:
POST /api/apps/v1/user/avatar - Multipart Key:
image(oravatar) - Supported Formats: JPEG, PNG, WebP, GIF
- Max Upload Size: 5 MB (5120 KB)
- Server Processing: Intervention Image v3 automatically crops to a 300x300 px square
- Compression: Converted to WebP at 85% quality for instantaneous mobile loading
- Storage Location:
profile/avatar/{user_id}_{timestamp}.webp - Delivery URL:
https://cdn.pixahunt.com/profile/avatar/... - Storage Auto-Cleanup: When a user updates or deletes their avatar, the server automatically purges the previous file from Bunny CDN storage.
🖼️ Cover Banner Image Rules
- Upload Endpoint:
POST /api/apps/v1/user/cover - Multipart Key:
image(orcover) - Supported Formats: JPEG, PNG, WebP
- Max Upload Size: 10 MB (10240 KB)
- Server Processing: Automatically crops to a 900x300 px banner (3:1 aspect ratio)
- Compression: Converted to WebP at 85% quality
- Storage Location:
profile/cover/{user_id}_{timestamp}.webp - Delivery URL:
https://cdn.pixahunt.com/profile/cover/... - Storage Auto-Cleanup: Old cover banners are automatically removed from Bunny CDN storage upon upload or deletion.
AccessKey) or upload directly to Bunny CDN storage endpoints. All uploads must be routed through Pixahunt's authenticated API endpoints using the user's Bearer token. The server securely handles Bunny CDN authorization, resizing, WebP encoding, and old-file garbage collection.
4. Complete API Endpoints Reference
A. Get Current User Profile
Endpoint: GET /api/apps/v1/user/profile
Headers: Authorization: Bearer <token>, Accept: application/json
Sample Response (HTTP 200 OK):
{
"status": true,
"message": "Profile retrieved successfully",
"data": {
"core_info": {
"id": 1,
"username": "johndoe",
"fullname": "John Doe",
"email": "john@pixahunt.com",
"status": "ACTIVE",
"is_verified": true,
"is_staff": false,
"is_contributor": true,
"is_customer": false,
"registered_at": "2024-05-12 14:30:00",
"last_seen_at": "2026-10-09 11:45:00"
},
"profile_info": {
"about": "Digital artist & UI/UX designer on Pixahunt.",
"location": "Dhaka, Bangladesh",
"website": "https://johndoe.design"
},
"images": {
"avatar_url": "https://cdn.pixahunt.com/profile/avatar/1_1728458900.webp",
"avatar_path": "profile/avatar/1_1728458900.webp",
"has_custom_avatar": true,
"cover_url": "https://cdn.pixahunt.com/profile/cover/1_1728458900.webp",
"cover_path": "profile/cover/1_1728458900.webp",
"has_custom_cover": true
},
"social_profiles": {
"behance": "https://behance.net/johndoe",
"dribbble": "https://dribbble.com/johndoe",
"pinterest": "",
"shutterstock": "",
"freepik": "",
"vecteezy": "",
"adobe": "",
"lovepik": "",
"pngtree": ""
},
"privacy_settings": {
"emailshow": 0,
"allow_follow": 1,
"allow_friend": 1,
"msg_privacy": "everyone",
"showme": 1
},
"field_matrix": {
"editable_fields": { ... },
"read_only_fields": [ "id", "username", "email", "status", "is_verified", "is_staff", "is_contributor", "is_customer", "registered_at", "last_seen_at" ]
},
"bunny_cdn_specs": { ... }
}
}
B. Update User Profile
Endpoint: POST /api/apps/v1/user/profile (or PUT /api/apps/v1/user/profile)
Headers: Authorization: Bearer <token>, Content-Type: application/json, Accept: application/json
Sample Request Payload:
{
"fullname": "John Doe",
"location": "New York, USA",
"about": "Senior 3D Artist creating vector mockups & digital gadget assets.",
"website": "https://johndoe.design",
"emailshow": 0,
"allow_follow": 1,
"allow_friend": 1,
"msg_privacy": "everyone",
"showme": 1,
"behance": "https://behance.net/johndoe",
"dribbble": "https://dribbble.com/johndoe",
"freepik": "https://freepik.com/author/johndoe"
}
Sample Response (HTTP 200 OK):
{
"status": true,
"message": "Profile updated successfully",
"data": {
"core_info": { ... },
"profile_info": { ... },
"images": { ... },
"social_profiles": { ... },
"privacy_settings": { ... }
}
}
C. Upload User Avatar (Bunny CDN)
Endpoint: POST /api/apps/v1/user/avatar
Headers: Authorization: Bearer <token>, Accept: application/json
Content-Type: multipart/form-data
Form Field: image (or avatar) with the binary image file.
Sample Response (HTTP 200 OK):
{
"status": true,
"message": "Avatar uploaded, optimized, and deployed to Bunny CDN successfully.",
"avatar_url": "https://cdn.pixahunt.com/profile/avatar/1_1728461234.webp",
"avatar_path": "profile/avatar/1_1728461234.webp",
"specs": {
"format": "webp",
"dimensions": "300x300",
"quality": 85,
"size_bytes": 16420,
"storage": "Bunny CDN Storage Zone (pixahunt)",
"delivery": "Bunny CDN Edge Cache (cdn.pixahunt.com)"
},
"user": {
"id": 1,
"username": "johndoe",
"avatar_url": "https://cdn.pixahunt.com/profile/avatar/1_1728461234.webp"
}
}
D. Delete User Avatar
Endpoint: DELETE /api/apps/v1/user/avatar (or POST /api/apps/v1/user/avatar/delete)
Headers: Authorization: Bearer <token>, Accept: application/json
Sample Response (HTTP 200 OK):
{
"status": true,
"message": "Avatar deleted successfully. Restored system default avatar.",
"avatar_url": "https://cdn.pixahunt.com/profile/xavt.jpg"
}
E. Upload User Cover Banner (Bunny CDN)
Endpoint: POST /api/apps/v1/user/cover
Headers: Authorization: Bearer <token>, Accept: application/json
Content-Type: multipart/form-data
Form Field: image (or cover) with binary image file (max 10 MB).
Sample Response (HTTP 200 OK):
{
"status": true,
"message": "Cover banner uploaded, optimized, and deployed to Bunny CDN successfully.",
"cover_url": "https://cdn.pixahunt.com/profile/cover/1_1728461234.webp",
"cover_path": "profile/cover/1_1728461234.webp",
"specs": {
"format": "webp",
"dimensions": "900x300",
"quality": 85,
"size_bytes": 52140,
"storage": "Bunny CDN Storage Zone (pixahunt)",
"delivery": "Bunny CDN Edge Cache (cdn.pixahunt.com)"
},
"user": {
"id": 1,
"username": "johndoe",
"cover_url": "https://cdn.pixahunt.com/profile/cover/1_1728461234.webp"
}
}
F. Delete User Cover Banner
Endpoint: DELETE /api/apps/v1/user/cover (or POST /api/apps/v1/user/cover/delete)
Headers: Authorization: Bearer <token>, Accept: application/json
Sample Response (HTTP 200 OK):
{
"status": true,
"message": "Cover banner deleted successfully.",
"cover_url": null
}
5. Client Application Implementation Examples
Flutter / Dart (Multipart Avatar Upload)
import 'dart:io';
import 'package:http/http.dart' as http;
Future<void> uploadAvatar(String token, File imageFile) async {
final uri = Uri.parse('https://pixahunt.com/api/apps/v1/user/avatar');
final request = http.MultipartRequest('POST', uri)
..headers['Authorization'] = 'Bearer $token'
..headers['Accept'] = 'application/json'
..files.add(await http.MultipartFile.fromPath('image', imageFile.path));
final streamedResponse = await request.send();
final response = await http.Response.fromStream(streamedResponse);
if (response.statusCode == 200) {
print('Avatar uploaded to Bunny CDN: ${response.body}');
} else {
print('Upload failed (${response.statusCode}): ${response.body}');
}
}
Kotlin / Android (Retrofit / OkHttp Multipart)
val file = File(imagePath)
val requestFile = file.asRequestBody("image/*".toMediaTypeOrNull())
val body = MultipartBody.Part.createFormData("image", file.name, requestFile)
apiService.uploadAvatar("Bearer $token", body).enqueue(object : Callback<AvatarResponse> {
override fun onResponse(call: Call<AvatarResponse>, response: Response<AvatarResponse>) {
if (response.isSuccessful) {
val cdnUrl = response.body()?.avatar_url
// Update UI with new CDN Avatar
}
}
override fun onFailure(call: Call<AvatarResponse>, t: Throwable) {
// Handle error
}
})
Swift / iOS (URLSession Multipart Upload)
func uploadAvatar(token: String, imageData: Data, completion: @escaping (Result<String, Error>) -> Void) {
let url = URL(string: "https://pixahunt.com/api/apps/v1/user/avatar")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue("Bearer \(token)", forHTTPHeaderField: "Authorization")
request.setValue("application/json", forHTTPHeaderField: "Accept")
let boundary = "Boundary-\(UUID().uuidString)"
request.setValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type")
var body = Data()
body.append("--\(boundary)\r\n".data(using: .utf8)!)
body.append("Content-Disposition: form-data; name=\"image\"; filename=\"avatar.jpg\"\r\n".data(using: .utf8)!)
body.append("Content-Type: image/jpeg\r\n\r\n".data(using: .utf8)!)
body.append(imageData)
body.append("\r\n--\(boundary)--\r\n".data(using: .utf8)!)
URLSession.shared.uploadTask(with: request, from: body) { data, response, error in
// Parse JSON response and update profile view
}.resume()
}