# 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:** [October 10, 2017, 8:45pm 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:** 1

<div class="post-metadata">

**Author:** ![Frank\_Bailey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/frank_bailey/32/83927_2.png) [@Frank\_Bailey](https://meta.discourse.org/u/Frank_Bailey)\
**Post date:** [October 10, 2017, 8:45pm UTC](https://meta.discourse.org/t/api-returning-user-id-of-1-when-uploading-avatar/71784/1 "2017-10-10T20:45:16Z")

</div>

I’m trying to use the Dischord API to upload user avatars. I’m testing with Postman because I couldn’t get it working with curl in PHP. With Postman I can see that the POST to the API is actually succeeding, but that the avatar is not assigned to any user. The response shows a user ID of -1, which would seem to indicate that something is going wrong in the background. Here is my Postman config

 ![upload_issue](https://global.discourse-cdn.com/meta/original/3X/4/6/4655f6799f94095d24b1ea50fd310cf4c46a30ae.jpg)

I can’t see anything obviously wrong with the way I’ve set it up, and the images are definitely getting uploaded and cropped and resized (I’ve checked that the URLs in the responses do in fact exist). If anyone has any insight into what might be going wrong I’d be grateful.

EDIT: The same response is received regardless of whether I set `synchronous` to `true` or `false`.

---

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