Dedicated media service for user-generated files. This service validates the authenticated user through the main Startvex users table, processes images safely on the server, and exposes the final media assets through the public media domain.
Accepts a multipart/form-data request with the authenticated access token and an image file. The service validates the token against the main users table, converts the image to JPG, resizes it proportionally to fit within 400x400 pixels, and stores it at /users/profile/<md5(user_id)>.jpg.
| Field | Type | Required | Description |
|---|---|---|---|
Content-Type |
header | Yes | multipart/form-data |
access_token |
string | Yes | Authenticated user access token. |
profile_image |
file | Yes | Image file in JPG, PNG or WEBP, up to 5 MB. |
| Status | Description |
|---|---|
| 200 | Upload completed and file replaced or created successfully. |
| 401 | Missing, invalid, or expired access token. |
| 415 | Unsupported image type. |
| 422 | Validation failed for the submitted form-data. |
| 500 | Server-side processing or filesystem failure. |
| Field | Type | Description |
|---|---|---|
message |
string | Operation result message. |
user_id |
integer | Authenticated user identifier derived from the access token. |
profile_image_path |
string | Relative public path stored by the application. |
profile_image_url |
string | Absolute public URL for the JPG image. |
width |
integer | Final JPG width in pixels. |
height |
integer | Final JPG height in pixels. |
size_bytes |
integer | Final file size in bytes. |
mime_type |
string | Final stored MIME type. |