# Using Python to upload avatar (Discourse API)

**URL:** https://meta.discourse.org/t/using-python-to-upload-avatar-discourse-api/219731
**Category:** Support
**Created:** [March 1, 2022, 6:59pm UTC](https://meta.discourse.org/t/using-python-to-upload-avatar-discourse-api/219731 "2022-03-01T18:59:50Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![Allan\_Campopiano](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/allan_campopiano/32/251599_2.png) [@Allan\_Campopiano](https://meta.discourse.org/u/Allan_Campopiano)
#### Post date: [March 1, 2022, 7:15pm UTC](https://meta.discourse.org/t/using-python-to-upload-avatar-discourse-api/219731/2 "2022-03-01T19:15:36Z")

</div>

Ooo! I discovered from [here](https://meta.discourse.org/t/uploading-a-local-image-using-the-api/127071) that I can use “url” as a parameter as follows:

```python
data={
"type": "avatar",
"user_id": user_id,
"synchronous": True,
"url": "url_to_my_image"
}

url = "<my_site>/uploads.json"

response = requests.request("POST", url, headers=headers, data=data)

```

I finally get a 200!

Now, I know there is a 2nd step I need to do to actually complete this process 🤔, let me see what I can do…

---

_[View the full topic](https://meta.discourse.org/t/using-python-to-upload-avatar-discourse-api/219731)._
