New User Avatar APIs

Barbara Czyż
Box Developer Blog
Published in
1 min readMay 24, 2022

Just a few days ago, we extended the user avatar management functionality with new endpoints. As a result, you can use the API to upload new avatars, update existing ones, and delete those you no longer need.

User avatars in Box

Adding or updating a user avatar

When you want to add a new avatar or update an existing one, use the POST /users-id-avatar request:

curl -i -X POST -L https://api.box.net/2.0/users/userID/avatar 
-H 'Authorization: Bearer <ACCESS_TOKEN>'
--form 'pic=@"path/to/file/file.jpeg"'

A successful avatar upload responds with a user avatar resource that contains URLs to the file location.

Deleting a user avatar

To delete a user avatar, use the DELETE /users-id-avatarrequest:

curl -i -X DELETE -L https://api.box.net/2.0/users/userID/avatar 
-H 'Authorization: Bearer <ACCESS_TOKEN>'

We hope you enjoy this enhancement, and please feel free to reach out to us on the developer forum for support, or via Box Pulse to make suggestions on how to improve the feature.

--

--