# API returning user ID of -1 when uploading avatar

**URL:** <https://meta.discourse.org/t/api-returning-user-id-of-1-when-uploading-avatar/71784>\
**Category:** Development\
**Created:** [10 Octubre, 2017 20:45 UTC](https://meta.discourse.org/t/api-returning-user-id-of-1-when-uploading-avatar/71784 "2017-10-10T20:45:16Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![MakaryGo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/makarygo/32/187426_2.png) [@MakaryGo](https://meta.discourse.org/u/MakaryGo)\
**Post date:** [10 Octubre, 2017 22:15 UTC](https://meta.discourse.org/t/api-returning-user-id-of-1-when-uploading-avatar/71784/3 "2017-10-10T22:15:59Z")

</div>

According to [http://docs.discourse.org](http://docs.discourse.org) I believe you should afterwards send a  
`PUT /users/{username}/preferences/avatar/pick`  
with `upload_id` returned by this.

---

_[View the full topic](https://meta.discourse.org/t/api-returning-user-id-of-1-when-uploading-avatar/71784)._
