# Off-site avatar via API?

**URL:** <https://meta.discourse.org/t/off-site-avatar-via-api/168370>\
**Category:** Development\
**Tags:** rest-api\
**Created:** [October 27, 2020, 10:55am UTC](https://meta.discourse.org/t/off-site-avatar-via-api/168370 "2020-10-27T10:55:51Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Judith](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/judith/32/289903_2.png) [@Judith](https://meta.discourse.org/u/Judith)\
**Post date:** [October 27, 2020, 10:55am UTC](https://meta.discourse.org/t/off-site-avatar-via-api/168370/1 "2020-10-27T10:55:51Z")

</div>

I have a community Rails site. I’m using SSO so that community members don’t have to separately log into Discourse and I’m using the Discourse API in order to facilitate exchange of information between the two servers. Now I’d like to unify user avatars, i.e. use the same avatar on the forum as on my main site. How do I do that?

I tried what I usually do for API requests, namely a Faraday POST request to [https://discuss.diem25.org/uploads.json](https://discuss.diem25.org/uploads.json) with API key and API-Username in the header and the following body:

```plaintext
{ 
          "type": "avatar", 
          "user_id": user_id,
          "file": "https://internal.diem25.org/.../user.jpg",
          "synchronous": "true"
        }

```

This request results in an Internal Server Error. I’m also not opposed to re-uploading the file as a last resort, but that seems to be difficult to impossible at first glance, using Faraday.

---

_[View the full topic](https://meta.discourse.org/t/off-site-avatar-via-api/168370)._
