Get Avatar
GET /api/user/avatar
Retrieve the user’s avatar image. Returns the raw avatar data (Base64 string or URL).
Request
curl -X GET https://your-zipline.com/api/user/avatar \
-H "Authorization: YOUR_TOKEN"
Response
Returns the avatar as a raw string (either Base64-encoded image data or a URL).
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==
Errors
- 404 Not Found: User has no avatar set
This endpoint returns the raw avatar string, not a JSON object. If no avatar is set, you’ll receive a 404 error instead of null.
Update Avatar
To update your avatar, use the PATCH /api/user endpoint with the avatar field:
curl -X PATCH https://your-zipline.com/api/user \
-H "Authorization: YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"avatar": "data:image/png;base64,iVBORw0KGgo..."
}'
Remove Avatar
To remove your avatar, set the avatar field to null:
curl -X PATCH https://your-zipline.com/api/user \
-H "Authorization: YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"avatar": null
}'