Skip to content

Powered by Grav + Helios

Upload Avatar

Upload Avatar

POST /users/{username}/avatar
Upload a custom avatar image for a user. Send as multipart/form-data.

Parameters

Name Type Description
username required string The username to upload the avatar for
avatar required file Image file (JPEG, PNG, GIF, or WebP)
JSON
{"data": {"username": "admin", "email": "[email protected]", "avatar": {"name": "admin-a1b2c3d4.jpg", "type": "image/jpeg"}}}

Response Codes

201 Avatar uploaded
401 Unauthorized
403 Forbidden
404 User not found
422 Validation error (no file or invalid image type)